Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    73

    Unanswered: ODBC Data Sources

    I am creating an ODBC connection programmatically in a function. I am using this code to spell out the detal on the connection. I am trying to set the default database but for some reason it doesn't work.
    Code:
               lngResult = SQLConfigDataSource(0, _
                                               ODBC_ADD_SYS_DSN, _
                                               "SQL Server", _
                                               "DSN=" & JDS_DSN_name & Chr(0) & _
                                               "Server=" & JDS_Server_name & Chr(0) & _
                                               "Trusted_Connection=" & Chr(1) & _
                                               "Database=RMAData" & Chr(0) & _
                                               "UseProcForPrepare=Yes" & Chr(0) & _
                                               "Description=RMA Database" & Chr(0) & Chr(0))

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    How do you know it does not work? Are you getting an error message? As well, why do you have a chr(1)? Should that be chr(0) or vbNullChar?

Posting Permissions

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