Option Explicit Sub UNO() Dim strCSVDirPath As String: strCSVDirPath = "c:temp" Dim strCSVFileName As String: strCSVFileName = "CSVExport.csv" Dim strTableName As String: strTableName = "CC_DAILY_Business" Dim objConnection: Set objConnection = CreateObject("ADODB.Connection") objConnection.Open "Provider=SQLOLEDB;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=REPORTING;Data Source=ssssss" Dim commandstring: commandstring = "SELECT * INTO [text;HDR=Yes;Database=" & _ strCSVDirPath & "]." & strCSVFileName & _ " FROM " & strTableName objConnection.Execute commandstring End Sub
have error in: objConnection.Execute commandstring
in other case i nee a fast way to export from sql table to csv file with ado and vb classic.