Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC SQLPassT error handling
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01545611
Message ID:
01545618
Views:
40
>I have one form open 24/7 and a global connection hanlder open from the main program (lnConn)from time to time the SQL Service become unavailable (please do not focus on this problem cause i am not trying to solve this) due to this, the lnConn becomes useless the form tries to read and write data to back end from time to time using SQL Passthrough like lnSQLResult = SQLEXEC(lnConn,"select * from table")
>i know if lnSQLResult is -1, this means something went wrongI know aerror retrieves the error from the SQLEXEC
>I Know element 1,1 is a Error Code
>I know element 5 is a error code too
>
>my question to you guys is the foloowing: what are the codes i have to test in order to know that there is a broken link between the computer and the SQL Server??best regards

I believe we do have some code, but I could not find it at the moment. So, I think the simplest way to test if the connection is still working is to do
send SELECT @@VERSION using SQLExec and the handle and trap the error.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform