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
Title:
Using SQLEXEC with ACCESS and blank dates ???
Miscellaneous
Thread ID:
00872515
Message ID:
00872515
Views:
57
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 !
____________________________
Luis Perez
Millennium Data Solutions, Corp.
President & CEO
e-mail: luis@mds-corp.com
http://www.mds-corp.com
USA
____________________________
Next
Reply
Map
View

Click here to load this message in the networking platform