I have a large csv file (about 10 million lines) that is too big to view with Excel, I'd like to automate Access from VB6 to import the file, so Access does the same steps that it would if I ran access and opened the file manually, and kept clicking "Next" until the file was loaded. This would be much faster then writing the file line by line into an Access table.
Is there a way to automate access so I can open a CSV file in just a few steps? I can't find the Access Object Model anywhere to guide me through this process.
None of the above 4 approaches work (3 are currently commented out).Code:Dim AccessObj As Object, filepath As String filepath = App.Path & "\test.csv" Set AccessObj = New Access.Application AccessObj.Visible = True 'AccessObj.DoCmd.OpenDatabase filepath 'AccessObj.OpenCurrentDatabase filepath 'AccessObj.DBEngine.OpenDatabase filepath, False, False AccessObj.ImportXML filepath
TIA,
Mike




Reply With Quote
