Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Connection

Status
Not open for further replies.

hannec

Programmer
Mar 22, 2004
37
BE
Hi,

i am using VFP9 and SQL server 2005.
I made a connection to a database :

Code:
STORE SQLSTRINGCONNECT('dsn=&database;uid=&datuser;pwd=&datpwd') TO handle
IF handle <= 0
	WAIT WINDOW 'Error'
else
   = MESSAGEBOX('Connection OK', 16, 'SQL Connect OK')
ENDIF


After 5 to 10 minutes the connection is gone. To fix that problem, the IdleTimeout is set to 0.

Code:
nSet=SQLSETPROP(Handle, "IdleTimeout", 0 )
IF nSet > 0
   =MESSAGEBOX("Timeout set to 0",0,"Connection Results")
ELSE
   =MESSAGEBOX("Error setting Timeout",0,"Connection Results")
ENDIF


But this does not help. In VFP7 i am using the same connection without problem.

What is wrong?

Thanks
EC
 
Are you using the latest ODBC driver in your connection to connect? SQL 2005 has a native sql driver. Try using that instead of the old sql server driver.

Regards,

Rob
 
Rob,

i am using now the native sql driver and the problem is solved.

Thank you.

EC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top