>>I am using VFP with MySql database. I have defined one cursoradapter. When my program execute cursorfill method VFP shows error 1543 type conversion required by the datatype property for field xxxxx is invalid. where xxxxx is date field. Why this error occurs?
>
>Additional information. xxxxx is datetime field and I using it on form with Activex DtPicker2
A key factor you will have to look into is the ODBC driver you're using, VFP's SQL functions are agnostic towards the RDBMS, they just interface with the ODBC driver.
Using a "MySQL ODBC 5.1 Driver", MySQL datetime columns are read as VFP datetime data type, and date columns as VFP date data type.
CLEAR
LOCAL lnConn AS Integer
m.lnConn = SQLCONNECT()
SQLEXEC(m.lnConn,"SELECT CAST(NOW() AS datetime) AS date1, CAST(NOW() AS date) AS date2","curTest")
? "date1 is",TYPE("curTest.date1")
? "date2 is",TYPE("curTest.date2")
SQLDISCONNECT(m.lnConn)
results in
date1 is T
date2 is D
----------------------------------
António Tavares Lopes