Environment versions
Network:
Windows 2003 Server
You can just try selecting anything. It doesn't matter if it returns an empty value or not, just that the statement returns a value > 0
IE.
xx = SQLEXEC(tnStatementHandle, [SELECT 'junk'], 'emptycursor') > 0
if xx > 0
* you still have a connection
endif
don't forget to get rid of your empty 'emptycursor'
>I considered that - but it takes a few seconds to actually make the connection - so I don't want to have to disconnect/reconnect if I don't have too.
>
>>The best way is to use SQLIDLEDISCONNECT() and let VFP handle it
>>
>>>I have a VFP9 app that's communicating with DB2 tables via ODBC.
>>>
>>>I use this command to do that of course:
>>>plnConnectionHandle = SQLSTRINGCONNECT( m.llValid = .t.
>>>
>>>...my problem is (or I *think* my problem is) that after a while this connection is no longer valid - I'm assuming it simply times out because the app doesn't use these tables much. What is a recommended way I can test to see if the connection is still good, and if not reconnect?
>>>
>>>Thanks!
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only