Discussion:
mySQL odbc 5.1 Bad Field Type.
(too old to reply)
Greg Neid
2008-11-29 21:36:13 UTC
Permalink
dBase 2.6.1.5 b2083
BDE 5.2.0.2
The mySQL odbc 5.1 driver gives the following error: "Bad field type". It all works in the 3.51 driver, but it will soon be time to move on to newer drivers.

Many field types do work, I have tested integer, varchar, decimal and timestamp.

However, a very simple select fails:
SELECT "a" -- fails
SELECT 1 -- works

This is a simple as I can make the problem. I am actuall interest in other Selects, such as SELECT UUID() which also fails.

Greg Neid
Marty Kay
2008-12-05 21:26:08 UTC
Permalink
The "Bad field type" error is a BDE error that we usually see when a query
includes a field with
a data type not recognized by the BDE. The most common field type with this
problem is a UNICODE
field type, such as nvarchar in MS SQL Server.

You can query such fields by casting them to a supported type within your
select statement.

The upcoming version of dBASE Plus containing ADO based database access will
handle
these field types automatically.

I'm not sure why the 3.51 driver works but the 5.1 driver fails.
I remember that some databases or drivers have a setting to autoconvert
fields either from UNICODE
to ANSI or vice versa. Perhaps there is such a setting in the MySQL
drivers...

- Marty -

Martin Kay
dataBased Intelligence, Inc.
Post by Greg Neid
dBase 2.6.1.5 b2083
BDE 5.2.0.2
The mySQL odbc 5.1 driver gives the following error: "Bad field type". It
all works in the 3.51 driver, but it will soon be time to move on to newer
drivers.
Many field types do work, I have tested integer, varchar, decimal and timestamp.
SELECT "a" -- fails
SELECT 1 -- works
This is a simple as I can make the problem. I am actuall interest in
other Selects, such as SELECT UUID() which also fails.
Greg Neid
Lysander
2008-12-08 10:57:51 UTC
Permalink
Post by Marty Kay
I'm not sure why the 3.51 driver works but the 5.1 driver fails.
Marty,
the 5.1 driver probably does not support the (outdated) ODBC standard
used by the BDE. I could not find the specification used by the 5.1
driver so I could not confirm, but if that is the case, CAST()ing the
fieldtype will not help.

regards,
André
Roland Wingerter
2008-12-08 20:14:50 UTC
Permalink
the 5.1 driver probably does not support the (outdated) ODBC standard used
by the BDE. I could not find the specification used by the 5.1 driver so I
could not confirm, but if that is the case, CAST()ing the fieldtype will
not help.
-------
See
http://dev.mysql.com/doc/refman/5.1-maria/en/connector-odbc-versions.html

Roland
Lysander
2008-12-09 10:28:50 UTC
Permalink
Post by Roland Wingerter
See
http://dev.mysql.com/doc/refman/5.1-maria/en/connector-odbc-versions.html
Thanks.
Found that also when taking a quick glance, but could not find any hint
on whether the driver is still compliant with ODBC 3.0x.

I might be wrong, but as far as I understand, BDE remained on ODBC 3.0.x
while the rest of the world advanced to ODBC 3.5 standard.

Usually the calls to ODBC are mapped through to functions in a
specialized client.DLL (like FBClient.DLL or GDS32.DLL or the
whatsitsname.DLL for MySQL) and - as it always is with "mapping"
functions - this only works if both sides of the mapping do agree on one
standard.
Greg Neid
2008-12-09 13:26:38 UTC
Permalink
I have looked at the standard. Although it is not yet a problem, I hope dBASE (and expect they are) is committed to meeting these new standrards. Soon support ofr the 3.51 ODBC will be dropped.

Also, we will want to be able to connect through new drivers from DataDirect.

Greg
Post by Lysander
Post by Roland Wingerter
See
http://dev.mysql.com/doc/refman/5.1-maria/en/connector-odbc-versions.html
Thanks.
Found that also when taking a quick glance, but could not find any hint
on whether the driver is still compliant with ODBC 3.0x.
I might be wrong, but as far as I understand, BDE remained on ODBC 3.0.x
while the rest of the world advanced to ODBC 3.5 standard.
Usually the calls to ODBC are mapped through to functions in a
specialized client.DLL (like FBClient.DLL or GDS32.DLL or the
whatsitsname.DLL for MySQL) and - as it always is with "mapping"
functions - this only works if both sides of the mapping do agree on one
standard.
Greg Neid
2008-12-09 08:57:14 UTC
Permalink
Hi marty,
I have tested with bthe following:

SELECT CAST("a" AS CHAR)

It fails also, in the same manner. If and when there is beta ADO code, I would be willing to do some testing with mySQL.

Greg
Post by Marty Kay
The "Bad field type" error is a BDE error that we usually see when a query
includes a field with
a data type not recognized by the BDE. The most common field type with this
problem is a UNICODE
field type, such as nvarchar in MS SQL Server.
You can query such fields by casting them to a supported type within your
select statement.
The upcoming version of dBASE Plus containing ADO based database access will
handle
these field types automatically.
I'm not sure why the 3.51 driver works but the 5.1 driver fails.
I remember that some databases or drivers have a setting to autoconvert
fields either from UNICODE
to ANSI or vice versa. Perhaps there is such a setting in the MySQL
drivers...
- Marty -
Martin Kay
dataBased Intelligence, Inc.
Post by Greg Neid
dBase 2.6.1.5 b2083
BDE 5.2.0.2
The mySQL odbc 5.1 driver gives the following error: "Bad field type". It
all works in the 3.51 driver, but it will soon be time to move on to newer
drivers.
Many field types do work, I have tested integer, varchar, decimal and timestamp.
SELECT "a" -- fails
SELECT 1 -- works
This is a simple as I can make the problem. I am actuall interest in
other Selects, such as SELECT UUID() which also fails.
Greg Neid
Loading...