Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trap for ODBC errors....
Message
 
To
29/07/2004 18:45:59
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00929370
Message ID:
00929407
Views:
7
ya I know I can do that one... but this project is in VFP7...grrrrr

>Victor,
>
>If you are using vfp8 you can use try entry to do this.
>
>
>
>try
> lnResult = sqlConnect('myTest')
>catch
>endtry
>if lnResult < 0
>  * handle here.
>endif
>
>
>>This won't work for me....
>>
>>The help says this:
>>
>>SQLSETPROP(nStatementHandle, cSetting [, eExpression])
>>
>>Parameters
>> nStatementHandle - Specifies the statement handle to the data source returned by SQLCONNECT( ).
>>
>>.....so in order to use the SQLSETPROP I must have a connection handle, but if the SQLCONNECT fails & gives me an ODBC error, I wont have a connection handle.
>>
>>
>>>Hi Victor,
>>>
>>>Try this:
>>>
>>>=SQLSETPROP(0,"DispLogin",3) && Don't display LOGIN dialog, if any information missed
>>>=SQLSETPROP(0,"DispWarnings",.F.) && Don't display warning dialog, if any set don't correctly
>>>x = sqlConnect('myTest')
>>>if x<=0
>>>   * Error, use AERROR()
>>>endif
>>>
>>>
>>>MartinJ
>>>
>>>>We have something like this....
>>>>
>>>>ON ERROR wait window ('Problem')
>>>>x = sqlConnect('myTest')
>>>>
>>>>The problem is that when we get an ODBC error (connection falied, communications failure, etc) - the ON ERROR doesn't trap the error because it's not a VFP error - it's an ODBC error. Does anyone know how we can trap for this error?
>>>>
>>>>Thanks!
ICQ 10556 (ya), 254117
Previous
Reply
Map
View

Click here to load this message in the networking platform