Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check whether a connection still exists?
Message
 
To
09/01/2004 12:44:50
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00865357
Message ID:
00865516
Views:
17
Peter,

You always can check for aa[1,1] or aa[1,2] to get the error number and error description. Like:
if aerror(laError)>0 and laError[1,1]=1466 && VFP error number
?laError[1,2] &&Connection handle is invalid
endif

You could filter out other error as well


>Hi Yuri,
>
>I already have the aerror() information at that point. My coding is something like this:
>
>on error do logerror
>
>procedure logerror
>
>=aerror(laError)
>=sqlexec(gnHandle, "insert into logtable...")
>
>The problem with this coding is that =sqlexec(gnHandle, "insert into logtable...") may generate error if the error which has trigger on error routine is caused by connection problem. So, I want to have a checking before I execute that statement:
>
>on error do logerror
>
>procedure logerror
>
>=aerror(laError)
>if no connection problem */ this is the part I cannot figure how to code this
> =sqlexec(gnHandle, "insert into logtable...") */ sql server table
>else
> insert into logtable */ foxpro table
>endif
>
>
>Thank you for your help,
>
>Peter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform