Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reconnect a remote view to SQL server.
Message
From
06/07/2006 09:43:02
Walter Meester
HoogkarspelNetherlands
 
 
To
05/07/2006 05:24:05
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01133536
Message ID:
01134125
Views:
40
Hi aleksey,

I'm not sure I understand this.

My application uses a shared connection made by SQLSTRINGCONNECT(). All remote views and SPT are using this connection.

After I detect the connection has been broken I do a SQLIDLEDISCONNECT(Applic.SQLhandle) to close the connection. This sometimes works, but in other cases it does not.

If I get the connectionhandle via CURSORGETPROP("Connectionhandle", Myview) and use that handle in SQLIDLEDISCONNECT(), the function is returning -1. Even using 0 as a parameter returns -1.

The ODBChdbc and ODBChstmt do still contain numbers (are not set to 0).

The problem as I see it is that I have to detect the disconnect before I try to requery() it. Once I don't do that, SQLIDLEDISCONNECT() does not reconnect the disconnected view.

Can you confirm this problem ?

Walter,









>>but in a test I already tried that. Sometimes success, sometimes it just does not work: The view won't reconnect.
>>
>
>Hi Walter,
>
>This may happen with shared connection. If ODBC connection is shared between multiple SPT connections, SQLIDLEDISCONNECT() must be called for all of them, ODBChdbc property should return 0 in order to automatically reestablish "broken" connection.
>
>Thanks,
>Aleksey.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform