Claus Mygind
2008-09-17 12:19:31 UTC
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'
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'