Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CA Builder How to Mark McCasland Please
Message
 
 
To
14/11/2003 00:55:04
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00848600
Message ID:
00850006
Views:
29
>Just something I need to know - again!
>
>In the init :
>
>This.DataSource = sqlstringconnect([Driver={Sql Server};Server=localhost;Database=New32;Int Security;])
>
>Now after CURSORFILL() and before doing a TABLEUPDATE() or REQUERY(), if the connection for any reason is broken to SQLSERVER, This.Datasource stays the same value. When I run this code, the CA returns me nothing other than .F. from CursorFill(). And no cursor is created.
>
>How can I check whether the connection is still good without checking whether the cursor is created or the return value?

AFAIK, there is no easy way to see if the connection is still good. If you get a bad return value [i.e., .F.] from a TABLEUPDATE(), the best you can do is check AERROR() return results.

I also never put the connection string as the DataSource. I create the connection programmaticaly and store that handle to a goApp connection property. I then set the DataSource to =goApp.nConnectHandle. Just remember to include the equal sign so the property value is evaluated at runtime instead of treated as just a string.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform