Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using SQLEXEC with ACCESS and blank dates ???
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00872515
Message ID:
00872519
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform