• WHY error to export from sql table to csv file!!

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » WHY error to export from sql table to csv file!!

    Author
    Topic
    #464984
    Code:
    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.

    Viewing 1 reply thread
    Author
    Replies
    • #1192732

      Does the folder c:temp exist on your hard disk?

      • #1192744

        Does the folder c:temp exist on your hard disk?

        in other case i nee a fast way to export from sql table to csv file with ado and vb classic.

    • #1192771

      Are you sure it’s your hard disk that’s being referenced by C:TEMP? Does the folder exist on the database server?

    Viewing 1 reply thread
    Reply To: WHY error to export from sql table to csv file!!

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: