Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DB Record not added until App is closed
Message
De
08/04/2005 18:35:35
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Divers
Thread ID:
01002598
Message ID:
01002911
Vues:
16
>I have an application that makes use of VFP DBs outside of VFP. Because of this I created a DLL to access the data and I also make use of ADO. (Application is still in development phase and has not yet been deployed) I have had no problem with the databases until recently. I have a page that will create a new record in the DB if a record does not already exist with the key accessed. (Checks for record with ADO - adds if does not exist through DLL) The first time I access the page for a key it seems to work fine. The key is not located and a record is created so I edit the other fields for the record and save it back to the record. (Save of information is done with DLL) Then when I try to access the same record again by reopening the page for that key it is not found and gets added again. When I close down my application and check the database there are two records - one with the information from the first time I opened it with my edited information and another from the second
>time I accessed the data with just the key. What could be happening here? Is the DLL holding on to the DB and keeping it open, therefore not propigating my change until it is closed, which happens when the whole application is closed? Can anyone shed some light on this?
>
>Thanks for all your help!

Sam,
If key is indexed as primary or candidate VFP wouldn't let you add another.
Sounds like there is a flaw in your check, add, update process. Why do you check a key's existence? Directly insert a new record and let VFP assigns a key for you. Or better yet add your unique key and new data at once.
Even if you check, you'd do it just before Update'ing an AddNew, no?
I didn't understand ADO and DLL. Why not one or the other (might be of course)? Maybe it's that mixture making things complicated.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform