Results 1 to 5 of 5
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Does the folder c:\temp exist on your hard disk?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    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.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I'm sorry, I can't help with that.

  5. #5
    New Lounger
    Join Date
    Dec 2009
    Location
    Stockholm, Sweden
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you sure it's your hard disk that's being referenced by C:\TEMP? Does the folder exist on the database server?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •