Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting to an Access database
Message
De
13/11/2001 15:34:31
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Inserting to an Access database
Divers
Thread ID:
00581101
Message ID:
00581101
Vues:
56
I need some help on the following :

I have been trying to insert a record to an Access database. I get an error when I try to insert it to a date field in the Access database.
Here is the code :

******************************************************************
lcCourse = CourseList.Name && Get the name from CourseList cursor
lcEmployeeName = EmployeeList.Name && get the employee form EmployeeList cursor

ldDate = DTOC(Thisform.txtTrainingDate.Value)

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 ( course , name , date );
Values ( " + "'" + lcCourse + "' , ;
" + "'" + lcEmployeeName + "' , ;
" + "'" + ldDate + "' ) ")

*******************************************************************

I get the following error :

OLE IDispatch exeption code 0 from Microsoft Jet database Engine:
Syntax error in INSERT INTO statement...

Any help would be appreciated.

Thanks,
Sergio
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform