Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using SQLEXEC with ACCESS and blank dates ???
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00872515
Message ID:
00872519
Vues:
16
I don't think Access supports blank dates. Insert a NULL value instead.



>THE CHALLENGE: I have to insert records from a VFP table to an Access MDB.
>THE SOLUTION: Use a DSN to Access and SQLEXEC !!
>
>Not quite, I am having the following issue.
>
>DSN name is "INFORM"
>
>cnHandle = SQLCONNECT("INFORM")
>lDate = {01/01/04}
>crun = SQLEXEC(cnHandle,"INSERT INTO MyTable (DateOfBirth) VALUES('" ;
> + lDate + "')")
>? crun provides a 1 which means the SQLEXEC actually worked and it succesfuly inserted a record into Access MDB.
>
>BUT IF I DO THE FOLLOWING:
>
>cnHandle = SQLCONNECT("INFORM")
>lDate = { / / }
>crun = SQLEXEC(cnHandle,"INSERT INTO MyTable (DateOfBirth) VALUES('" ;
> + lDate + "')")
>? crun provides a -1 which means the SQLEXEC didn't work !
>
>I do have blank date fields in the records I need to exprt to the Access table.
>
>I have larady tried tons of ocmbinations usinf DTOC() and CTOD() and other ideas but to no avail...
>
>Abyvody has ANY ideas ?
>
>thanks !
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform