CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2008
    Posts
    74

    connect mysql using dsn

    hi,
    i want connect a mysql server
    i can connect using this code:

    cnMySql.CursorDriver = rdUseOdbc
    cnMySql.Connect = "dsn=teste;"
    cnMySql.EstablishConnection

    the problem is that the connection only work for 24 hours
    then a msg appear to connect again, when he connect for the first time
    the msg don´t appear again but in next day appear again.
    the dsn in windows is configured for auto connect but don´t have diference.
    what i need change in the connect string for direct connect the server?
    thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: connect mysql using dsn

    Have the program check to see if it's connected every hour or two
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured