Results 1 to 6 of 6

Thread: MySQL and VB6

  1. #1
    Addicted Member
    Join Date
    Sep 00
    Location
    UK
    Posts
    199

    MySQL and VB6

    Hi All

    I am using the following connection string:

    Code:
    ConnectionString = Driver={MySQL ODBC 5.1 Driver};Server=XXXX;Port=3306;Database=XXXX;User=XXXX; Password=XXXX;Option=3;
    Which works fine.

    If the MySQL database server is not there, the VB6 application opens the MySQL Connector window.
    Is there any way I can trap/prevent this and handle the error myself ie msgbox/shut down app etc?


    Thanks
    Paul

  2. #2
    Frenzied Member
    Join Date
    May 06
    Location
    some place in the cloud
    Posts
    1,627

    Re: MySQL and VB6

    It would be better if you post the whole open procedure
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  3. #3
    Addicted Member
    Join Date
    Sep 00
    Location
    UK
    Posts
    199

    Re: MySQL and VB6

    Well...... Thats where I am lazy really.....

    I am using the Data Environment and do the following:

    Code:
    DE1.Conn1.ConnectionString = gStrConnectionString
    
    DE1.Commands("Fire").CommandText = "SET SESSION wait_timeout=86400"
    DE1.Commands("Fire").Execute
    Does this make things any clearer?


    Paul

  4. #4
    Frenzied Member
    Join Date
    May 06
    Location
    some place in the cloud
    Posts
    1,627

    Re: MySQL and VB6

    AFAIK
    If we use data environment to connect to a data provider it will use its own error handling and that's why it is asking for new credentials to establish connection again
    If we use our own code we will be able to handle the error...
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  5. #5
    Addicted Member
    Join Date
    Sep 00
    Location
    UK
    Posts
    199

    Re: MySQL and VB6

    Does this mean that I have no way of trapping the error then?

  6. #6
    Frenzied Member
    Join Date
    May 06
    Location
    some place in the cloud
    Posts
    1,627

    Re: MySQL and VB6

    That's my opinion, but I haven't much experience with data environment
    Let's see if there're others' opinion
    Last edited by jggtz; Sep 21st, 2012 at 09:07 PM.
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

Posting Permissions

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