Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting records to an Access database
Message
De
13/11/2001 15:21:24
 
 
À
13/11/2001 11:31:48
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00580922
Message ID:
00581098
Vues:
18
Why don't you just query the Access table for the record you just inserted?



>Hello everyone,
>
>I am inserting recods to an access database and I need to check if the records have been inserted succesfully. Can anyone tell me how to do that.?
>Here is the code : The code is located in the Click event of a command button within a form.
>
>
>*-- Insert a record to a VFP table
>lcNewID = newid("training")
>INSERT INTO training (training_id , name , date ) ;
> VALUES ( lcNewID, CourseList.name, Thisform.txtTrainingDate.Value)
>
>*-- Inset a record to an acces table
>lcCourse = CourseList.Name && get the name from a VFP table called CourseList
>lcMDBStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=l:\ehs\data\eh&s.mdb;"
>oCn = Create("adodb.Connection")
>oCn.Open(lcMDBStr)
>oCn.Execute("INSERT INTO Training ( name );
> Values ( " + "'" + lcCourse + "' ) ")
>Thisform.Reset()
>
>
>*******************************************************************************
>Thanks,
>Sergio
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform