Keeping MySQL connection via ODBC alive?? (1 Viewer)

perlfan

Registered User.
Local time
Yesterday, 21:35
Joined
May 26, 2009
Messages
192
Hi - I connect to MySQL via ODBC but after a few minutes the connection is dropped when the user is inactive.

I heard that changing the wait_timeout variable would help, but according to my provider it cannot be changed (just for my purposes).

Is there another way to keep the connection alive? Maybe there is a workaround that I haven't found yet.

Thanks a lot for help! FRANK
 

perlfan

Registered User.
Local time
Yesterday, 21:35
Joined
May 26, 2009
Messages
192
Well - I read that the following "pass through query" would help setting the wait_timeout parameter:

Code:
Connect property: 
ODBC;DRIVER={MySQL ODBC 5.1 Driver};SERVER=xxx.xxx.xxx.xxx;DATABASE=YourDatabaseName;OPTION=35;INITSTMT=SET @@wait_timeout=28800;UID=YourUserName;PWD=YourPassword

SQL property:
SELECT @@wait_timeout;

But how do I implement this?
This is how I connect to MySQL:

Code:
  Constr = "DRIVER={MySQL ODBC 5.1 Driver};Server=" & Server & _
 ";port=" & Port & ";user=" & user & ";Password=" & pw & ";Database=" & Datenbank
 
  Conn.Provider = "MSDASQL"
 Conn.Mode = adModeRead
 Conn.Open Constr
 Conn.CursorLocation = adUseClient

Thanks for some practical advice!

FRANK
 

Users who are viewing this thread

Top Bottom