Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I use VFP buffering when data is in sql server?
Message
De
18/08/2012 16:39:57
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
MS SQL Server
Divers
Thread ID:
01550574
Message ID:
01550729
Vues:
57
>>>>>>Building a new VFP application with data in SQL Server, using remote views to access it. Tables have autoincrementing identity field. I am using Codemine framework which takes care of transactions so I am not too familiar with those details.
>>>>>>
>>>>>>If data were in dfb tables, I'd use VFP table buffering while user is entering data and when everything is ok do TABLEUPDATE within a transaction so can back out in case of trouble. Even while using buffering, autoincrementing fields are properly incremented by VFP, so parent keys are immediately available to relate child records.
>>>>>>
>>>>>>How should I handle this situation when data is in SQL Server? If using VFP buffering, should I use temporary values for autoincrementing fields in order to relate parent and child tables, or is there another way of doing it?
>>>>>>
>>>>>>TIA,
>>>>>>
>>>>>>Alex
>>>>>
>>>>>What I've done is let SQL Server generate (auto-increment) the primary keys & then requery the remote view if I need the value of it for some reason.
>>>>
>>>>Can you requery in the middle of a transaction?
>>>
>>>Well the problem with that is you have to do a tableupdate() prior to doing the requery in order to get the newly added primary key....so if you need that primary key to use as a foreign key in another table then you need to be careful the order you do the tableupdates() in.
>>
>>Thanks. I need more experience on this matter. Advice is welcome.
>>
>>Alex
>
>I am with Borislav on this; CursorAdapter works very well with SQL Server. You have flexibility and power to control how and when to update. With CA, when a new record is added to the SQL Server table and Identity/PK field gets a value the CA cursor automatically reads it. If you are not 100% committed to Codemine framework, I would recommend to look into the CA approach.
H

Gracias Dmitry. Actually I am committed to Codemine, which I find can also query for the identity valu.
I will try to use temporary indices (negative numbers) for for relations while buffering data.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform