Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vfp7 & mysql

Status
Not open for further replies.

ids4ids

Technical User
Jun 17, 2004
26
RO
Hi,

I'm using vfp7, mysql 5.0, mysql odbc 3.51 and win xp professional ver.2002 sp2. I connect to mysql database using "option=3" in myodbc parameters.

I have mysql table Tabela1 with fields:

nrinv varchar 13
durata1 decimal 4
durata2 decimal 6,2
durata3 decimal 6,2
valinv decimal 14,2

The cursor with query results has fields:

nrinv character 13
durata1 integer 4
durata2 character 8
durata3 character 8
valinv currency 8

Why the type of fields durata2 and durata3 are not like the type of field valinv ?
 
You can solve the problem by changing field type from DECIMAL in FLOAT ... I think it is a bug in ODBC.
 

I don't know if it's a bug in the ODBC driver, but surely the best way to solve it would be to use DBSETPROP() to change the data type within the remote view. You only have to do that once (at the time you create the view), after which you can reference the field with the correct datatype.

If you're not using a remote view, just cast the fields to the correct data type in your SQL SELECT statement.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top