Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opened tables after SQL statements
Message
 
 
À
10/05/2000 18:52:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00368365
Message ID:
00368370
Vues:
19
>In my project there is a sub-program, which is called from different programs, forms or objects. It execute some SQL statements and prepare a new table as a final result. It works fine, but there is a problem with diferent environments from where my sub-program was called. Sometimes all tables are closed, sometimes there is two or three tables or even cursors opened and it is important that when sub-program finished its work, everything is just as it was before the sub-program starts, even the record positions in all data areas.
>So, I think, the sub-program must first find out what tables and cursors are opened, what is the order on that tables, what is the relations between them and record positions on each. With execution of an SQL statement tables are opened automatically, so it's rather complicated to finish the job correctly.
>Is there any simple solution for my problem?
>
>Thanks, Zlatko.

I don't know why your SQL Selects are messing up your cursors. They are supposed to open the underlying tables/view s again to avoid the problem with moving record pointers. Are you doing other processing that does move the record pointer?

IAC, if you are using VFP 6.0 SP3 you can use the new Session object to create a private datasession. You can have methods in your custom session object to open any tables you need, perform any SQL statements and create a result set. Because the result set must exist in the datasession that called the function, I would use ADO and the VFPCOM utility to create an ADO recordset from the resulting cursor and pass that back to the calling function. Then you could use the VFPCOM object again to turn the ADO recordset back into a cursor.

I don't know what the overhead would be for something like this but it is a resonable (IMO) solution to your problem.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform