Discussion:
Works here but not there
(too old to reply)
Claus Mygind
2008-09-17 12:19:31 UTC
Permalink
This is a repost of a message I posted in install-config. As Ken Mayer felt
Jan Hoelterling could probably help me and I know he hangs out in this news
group I am posting again.

I have run across a strange problem which seems to make no sense. My
company has given me a new faster computer (dual boot) Vista and XP. I am
working on the XP side. I still have my old test machine (XP) availble. It
should also be noted that the data resides on a third coomputer so both
machines are accessing the same data using the same ODBC driver with
identical BDE connections.

These are web application but this is really a basic sql select question /
problem.

The crux of the problem the sql statement will not accept the * wildcard, it
returns a bad field type error. If I specify every field, I do not have
problems (as illustrated code below).

When I use the new machine as a typical user and access the older test
machine to return the data, there are no problems.

I started with verison 2.6.0.0 b 1899. I have now installed dBase verison
2.61.5 and still encounter the same problem. So something is missing here.
(Also note Ken suggested I check the .ini files which I have done and they
are fine).

So any suggestions from anyone is welcome as to where to look. And Jan if
you are out there let me know what you think.

Claus

Here is the code for each call:
q = new QUERY()
q.database = db
cSelect = getSelect(nSelect)
cSql = [select ]+cSelect + [ from job where jobNo = something ]
q.sql = cSql
q.requestLive = false
q.active = true

This works:

function getSelect(cSelect)

cSelect = [t1.JOBID, t1.JOBDATE, t1.JDEPTID, ]

cSelect += [t1.PRJCTNAME, t1.PRJCTADDR1, t1.PRJCTCITY, t1.PRJCTST,
t1.PROPID, ]

cSelect += [concat( t2.id ) as rId, concat( t2.name ) as rName, ]

cSelect += [concat( t3.id ) as cId, concat( t3.name ) as cName, concat(
t3.billcontac )as cBContac ]

return(cSelect)


This does not work:

function getSelect(cSelect)

cSelect = [t1.*, ]

cSelect += [concat( t2.id ) as rId, concat( t2.name ) as rName,] cSelect +=
[concat( t3.id ) as cId, concat( t3.name ) as cName, concat( t3.billcontac )
as cBContac]

return(cSelect)


Here are the results:

The one that works:

{"JOBID":"65000","JOBDATE":"11/08/2005","JDEPTID":"2260","PRJCTNAME":"ST
JAMES SENIOR HOUSING","PRJCTADDR1":"EAST NEST DRIVE & RICHTON
ROAD","PRJCTCITY":"CRETE","PRJCTST":"IL","PROPID":"
,"rId":"SKEN0001","rName":"Skender Construction
company","cId":"SKEN0001","cName":"Skender Construction
Company","cBContac":" "};;{"_OnlyOneRow_":"65000"}


The one that does not work:

An error occured;in file: C:\...getdata.prg;on line no:107;

Error: Bad field type.

select t1.*, concat( t2.id ) as rId, concat( t2.name ) as rName,concat(
t3.id ) as cId, concat( t3.name ) as cName, concat( t3.billcontac ) as
cBContac from job t1 left join master t2 on t1.id=t2.id left join master t3
on t1.comid=t3.id where jobid = '65000'
Lysander
2008-09-17 13:00:43 UTC
Permalink
Post by Claus Mygind
cSelect += [t1.PRJCTNAME, t1.PRJCTADDR1, t1.PRJCTCITY, t1.PRJCTST,
t1.PROPID, ]
Are those _ALL_ Fields you have in that table?
Which format are we talking about, MySQL?


The first thing that comes to mind as you are describing the scenario is
that you have NOT an exact copy of the installation (BDE, ODBC-driver,
dBase).

Check all BDE settings, and all settings of the MySQL-ODBC-driver; they
all should be absolutely identical.

If you did an uninstall and then re-install the BDE, make sure there are
not 2 of them on that new machine, and that you are changing settings in
one, while another one is being activated by dBase.
Claus Mygind
2008-09-17 13:27:45 UTC
Permalink
Thanks Andre,

I called up dBase and tried to open the tables with just "use table" and
got the same error "Bad Field Type".

So I am going to uninstall and cleanse the entire machine. Then I will
reinstall the drivers to see if I have any luck.

At least now I know it is not the sql select statement.

Will report back

Claus
Lysander
2008-09-17 13:48:24 UTC
Permalink
Post by Claus Mygind
I called up dBase and tried to open the tables with just "use table" and
got the same error "Bad Field Type".
Sounds exactly like a faulty installation of the ODBC-driver, or a wrong
setting in the BDE. You would get this with firebird - for example -
when accessing a table in a newer format than the client-sided ODBC-driver.

No need to re-install, so far.
Check first the settings in the BDE, and that the ODBC-driver is
installed correctly.
Claus Mygind
2008-09-17 14:28:34 UTC
Permalink
Andre,

You were right. I did clean it out and reinstalled, eventhough you say I
did not have to. I got that working. So that was the problem.

Now another problem has crept up with my Apache server configuration. Ah!
the joys of upgrading.

Thanks for your timely help

Claus
Post by Lysander
Post by Claus Mygind
I called up dBase and tried to open the tables with just "use table" and
got the same error "Bad Field Type".
Sounds exactly like a faulty installation of the ODBC-driver, or a wrong
setting in the BDE. You would get this with firebird - for example - when
accessing a table in a newer format than the client-sided ODBC-driver.
No need to re-install, so far.
Check first the settings in the BDE, and that the ODBC-driver is installed
correctly.
Loading...