Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error 1543 type conversion required by the datatype prop
Message
De
17/06/2016 05:49:13
 
 
À
16/06/2016 20:53:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MySQL
Application:
Desktop
Divers
Thread ID:
01637446
Message ID:
01637450
Vues:
53
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform