dcsimg
Results 1 to 5 of 5

Thread: ODBC call fails

  1. #1

    Thread Starter
    Lively Member Peekay's Avatar
    Join Date
    Sep 2006
    Location
    Witbank, South Africa
    Posts
    124

    ODBC call fails

    I have created and tested a MySQL database with DSN - see attachment.
    When I try to open the connection in VB6 I get an error - see attachment.
    What can be the problem?

    Name:  DSNbloem.jpg
Views: 115
Size:  61.2 KB

    Name:  DSNbloemVB.jpg
Views: 112
Size:  13.7 KB

    Thanks

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    1,499

    Re: ODBC call fails

    First (!!) Guess:
    ...... ("Conn1",,,"ODBC;DSN=IBMSbloem;")

    EDIT: Second Guess:
    It seems you're using DAO.
    Set Conn=wsODBC.OpenConnection never worked for me.
    I always had to use
    Dim DB As Database
    Set DB=wsODBC.OpenDatabase(myconnectionstring)
    Last edited by Zvoni; Jul 9th, 2018 at 04:14 AM.
    One System to rule them all, One IDE to find them,
    One Code to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    I say you're crazy not to!
    ---------------------------------------------------------------------------------
    For health reasons i try to avoid reading unformatted Code

  3. #3

    Thread Starter
    Lively Member Peekay's Avatar
    Join Date
    Sep 2006
    Location
    Witbank, South Africa
    Posts
    124

    Re: ODBC call fails

    Hi Zvoni,

    The is a semi-colon after the DSN name.

    The following code statement fails as well:

    Set DB = wsODBC.OpenDatabase("IBSMS", , , "ODBC;DSN=IBSMSbloem;")
    I have set the DAO reference.

    Thanks

  4. #4
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    1,499

    Re: ODBC call fails

    Remove the semicolon after the DSN-Name.
    One System to rule them all, One IDE to find them,
    One Code to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    I say you're crazy not to!
    ---------------------------------------------------------------------------------
    For health reasons i try to avoid reading unformatted Code

  5. #5

    Thread Starter
    Lively Member Peekay's Avatar
    Join Date
    Sep 2006
    Location
    Witbank, South Africa
    Posts
    124

    Re: ODBC call fails

    I did try that before I posted,but it still failed.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width