Jun
5th
Thu
5th
Option Explicit
Dim strDBPath : strDBPath = "c:\temp\test.mdb"
Dim strCSVDirPath : strCSVDirPath = "c:\temp\"
Dim strCSVFileName : strCSVFileName = "CSVExport.csv"
Dim strTableName : strTableName = "SomeTable"
Dim objConnection : Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider = Microsoft.Jet.OLEDB.4.0; " & _
"Data Source = " & strDBPath
Dim commandstring : commandstring = "SELECT * INTO [text;HDR=Yes;Database=" & _
strCSVDirPath & "]." & strCSVFileName & _
" FROM " & strTableName
objConnection.Execute commandstring (from: http://www.visualbasicscript.com/m_46549/tm.htm)