SQL Query must work but doesn't
Posted: Wed 22 Jun 2011 14:29
Hi
I use IBDac 3.10.0.16 with Delphi 7.01 (Enterprise) and a Firebird Server (classic) V1.5 on XP SP3, trying to migrate an old Delphi5 Project to IbDac.
I am very sorry to bother you with this, but I can not find a reason why this does not work as expected:
DM.AuxQry.sql.add('select * from auftrag where');
DM.AuxQry.sql.add('kunde = '+inttostr(kunde)+' and ');
DM.AuxQry.sql.add('Rechdatum between ');
DM.AuxQry.sql.add(' '''+von+''' and '''+bis+''' '); // 2 Date Values converted with DateToString
DM.AuxQry.sql.add(' and status between 1000 and 1050');
DM.AuxQry.Open;
count := DM.AuxQry.recordcount; //-- Recordcount is 0
DM.AuxQry.first;
DM.AuxQry.DisableControls;
while not DM.AuxQry.eof do begin // -- Loop is not entered, EOF is true
DM.AuxQry is a TIBCQuery.
The same SQL statement gets me 33.157 Records from the same table on IBExpert.
Anyone any idea?
TIA Rolf
I use IBDac 3.10.0.16 with Delphi 7.01 (Enterprise) and a Firebird Server (classic) V1.5 on XP SP3, trying to migrate an old Delphi5 Project to IbDac.
I am very sorry to bother you with this, but I can not find a reason why this does not work as expected:
DM.AuxQry.sql.add('select * from auftrag where');
DM.AuxQry.sql.add('kunde = '+inttostr(kunde)+' and ');
DM.AuxQry.sql.add('Rechdatum between ');
DM.AuxQry.sql.add(' '''+von+''' and '''+bis+''' '); // 2 Date Values converted with DateToString
DM.AuxQry.sql.add(' and status between 1000 and 1050');
DM.AuxQry.Open;
count := DM.AuxQry.recordcount; //-- Recordcount is 0
DM.AuxQry.first;
DM.AuxQry.DisableControls;
while not DM.AuxQry.eof do begin // -- Loop is not entered, EOF is true
DM.AuxQry is a TIBCQuery.
The same SQL statement gets me 33.157 Records from the same table on IBExpert.
Anyone any idea?
TIA Rolf