Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Gianni Sassanelli
  Where is Gianni Sassanelli?
 Rome
 Italy
 Gianni Sassanelli
 Tags
Subject: RECOVERY a SQL CONNECTION
Thread ID: 155332 Message ID: 155332 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Sunday, December 30, 2007 1:03:53 PM         
   


Hi,
I need to recovery a lost connection to SQL if network was temporanealy down

I use a public variable to store the connections handle

public nconn
nconn = SQLSTRINGCONNECT([DRIVER=SQL Server;SERVER=MySqlServer;UID=sa;PWD=sa;APP=Microsoft Visual FoxPro;WSID=MYPCNAME;DATABASE=master])])

FUNCTION CustomSqlExec
LPARAMETERS CSTMT, cAlias, aCount
LOCAL nResult
nresult = SQLEXEC(nconn,CSTMT, cAlias, aCount)
IF nResult > 0
	RETU nResult
ELSE
	*!* in this case I woud want to inser code for testing if Connection to server was lost and then 
	1 ) retry the connection 
	2 ) Re-Execute the query
ENDIF




Can someone help me please

Thanks

ENTIRE THREAD

RECOVERY a SQL CONNECTION Posted by Gianni Sassanelli @ 12/30/2007 1:03:53 PM
RE: RECOVERY a SQL CONNECTION Posted by Gianni Sassanelli @ 12/30/2007 2:00:58 PM