Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Tim Lawrence
  Where is Tim Lawrence?
 Georgia - United States
 Tim Lawrence
 To: Borislav Borissov
  Where is Borislav Borissov?
 Borislav Borissov
Subject: RE: Invalid connection handle
Thread ID: 268990 Message ID: 268995 # Views: 27 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Thursday, July 15, 2010 10:20:29 PM         

> Sure it will behave that way.
> What you expected?
> The connection is lost and all transactions started with it are closed or reverted, you are not supposed to do anything more that REVERT tables and start again.

Thanks for the quick response Borislav,

Your answer does make sense and I was thinking along those same lines until I did the TABLEUPDATE successfully after reconnecting. (Incidentally, I left out one line of code in the previous post where I set the new connections to manual...). I'm just getting confused seeing one thing and expecting another

I guess what I was expecting is that
* since all transactions were closed or reverted upon disconnecting
* and some commands would work (TABLEUPDATE) after reconnecting
* no other properties of the CA had changed, then simply refreshing the data from SQL with the new connection would also work. (i.e.; for a grid)

The data remains since the CA object is in scope. Upon reconnecting, setting to manual transactions, the same data can be updated successfully--which I think runs through the CA object (AfterCursorUpdate).

I'm coming to the assumption that there is a type of relationship between the CursorFill and CursorRefresh methods: CursorRefresh cannot run if CursorFill has not run (DUH!) and when disconnecting and reconnecting, unless CursorFill is run successfully again, CursorRefresh will not run. It's like CursorFill "validates" the connection.

Does this make any sense?


Invalid connection handle Posted by Tim Lawrence @ 7/15/2010 9:01:23 PM
RE: Invalid connection handle Posted by Borislav Borissov @ 7/15/2010 9:09:32 PM
RE: Invalid connection handle Posted by Tim Lawrence @ 7/15/2010 10:20:29 PM