Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Odbc date query
Message
 
 
À
18/10/2011 11:04:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01526613
Message ID:
01526769
Vues:
44
>>>I am trying to pass date fields via ODBC into VFP table. I am getting ODBC error 22005 which seems to indicate a date format error. I have tried various date formats but can not find one that works. Does anyone know what the correct format should be in the table that I am sending the date field from.
>>>Barry
>>
>>Use parameters.
>>
>>ldDate = DATE()
>>SQLEXEC(handler, "SELECT * FROM VFPTable WHERE DateField = ?ldDate","SomeCursor")
>>
>>
>>BTW The last ODBC driver for VFP was for VFP6. If your tables use new field types this ODBC won't work.
>
>Hi Borislav,
>
>I am not doing a query, I am trying to insert data into a free VFP table from a simple text file on a hand-held data device that has 3 "fields" - Type,Date,User. eg "typeb","31/08/2011","myuser" - I have set up the ODBC connection but when I try to send the data set from the text file into the VFP table I get the ODBC error 22005. It appears to be something to do with the format of the date in the text file that is causing the problem.
>
>Barry

The universal date format is ISO dates, e.g. '20110831'

You may want to use varchar field and intermediate table and then convert dates to right format from SQL Server.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform