Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC and empty date
Message
 
To
08/01/2008 14:33:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01280300
Message ID:
01280312
Views:
19
>>>We're using a remote connection to a VFP database. When doing an INSERT with an empty date field I get a data mis-match error.
>>>? SQLPREPARE(myHandle, "insert into xyz (effect_dt) values (?m.datevar )")---> 1
>>>m.datevar=DATE()
>>>? SQLEXEC(myHandle) ----> 1
>>>m.datevar={}
>>>? SQLEXEC(myHandle) ----> -1
>>>=AERROR(laError)
>>>? laError[2] ----> "Connectivity error: [Microsoft][ODBC Visual FoxPro Driver]Data type mismatch"
>>>A straight SQL Insert
>>>INSERT INTO xyz (effect_dt) VALUES ( {} )
works just fine.
>>>
>>>Any insight will be greatly appreciated.
>>>
>>>TIA to all.........Rich
>>
>>There is NO such thing like EMPTY DateTime field in SQL Server.
>>That is why the only Fields I allow NULLs in them are datetime one.
>>If you insert an "EMPTY" datetime when you get data back you will see that you will get a perfectly valid date 01.01.1900.
>>SQL Server keeps DateTime as numeric valud that shows you how many seconds you should add to 01.01.1900 to get the value of the field.
>
>Thanks for the reply. However, this is going to a VFP database, not SQL Server. Does ODBC format queries to VFP tables as if they were for SQL Server?

ROFL!
I just saw that you use RC to VFP not to SQL Server. My mistake, sorry.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform