|
Question : record is too large
|
|
Hello nico5038 I wonder if you would be able to help me with the followinf problem. I create an access table programatically and need to import the fields' names from a csv file 's header row. That csv file has the data that will be imported to the created table in the next step. The problem is that when it comes to append method I get "record is too large" error. Here's the code. Thank you!
Sub MakeTable1() Dim xlApp As Excel.Application Dim NewWorkBook As Workbook Dim Newsheet As Worksheet Dim i as integer Set xlApp = New Excel.Application xlApp.Visible = True 'at this point I open the required csv file manually into this instance of Excel Set NewWorkBook = xlApp.ActiveWorkbook ' Set Newsheet = xlApp.ActiveSheet
Dim cat1 As ADOX.Catalog Dim tbl1 As ADOX.Table Dim cnn1 As ADODB.Connection 'Prepare to add table to Brokers1.mdb database. Set cnn1 = New ADODB.Connection cnn1.Open AccConnStr & "G:\MFS\IPA\SERGEI\ACCESS\Brokers1.mdb;" Set cat1 = New ADOX.Catalog Set cat1.ActiveConnection = cnn1
'Instantiate table, name it, and append columns. 'Assignment of ParentCatalog property is optional 'for a table without an AutoIncrement field.
Set tbl1 = New ADOX.Table With tbl1 .Name = "rt_transactions" i = 1 'Set .ParentCatalog = cat1 Do Until IsEmpty(xlApp.ActiveSheet.Cells(1, i).Value) .Columns.Append xlApp.ActiveSheet.Cells(1, i).Value, adWChar i = i + 1 Loop End With
'Append new table to Tables collection of MyNewDB. cat1.Tables.Append tbl1 ' THAT'S WHERE i GET THE ERROR MESSAGE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'Clean up objects. Set tbl1 = Nothing Set cat1 = Nothing cnn1.Close Set cnn1 = Nothing Set NewWorkBook = Nothing xlApp.Quit Set xlApp = Nothing End Sub
|
|
Answer : record is too large
|
|
Question Closed, 500 points refunded. PAQ_Man Community Support Moderator
|
|
|
|