>>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?