DeleteWhere Question
Posted: Wed 04 Jan 2006 05:28
Hi,
i have a Problem :
TMSQuery / TMSTable, SDAC 3.70.0.23, Delphi 2006
....
q_zip.sql:='SELECT Country,Zip FROM Zips'
...
q_zip.Close
q_zip.DeleteWhere
q_zip.AddWhere('Country='''D''')
q_zip.Open
DeleteWhere does'nt clear the where - condition.
If i set Debug=true, then i see
1. 'SELECT Country,Zip FROM Zips WHERE Country = ''D'' '
2. 'SELECT Country,Zip FROM Zips WHERE (Country = ''D'') AND Country = ''D'' '
'
and so on.
The where clause persist (but the BaseSql property remains ' 'SELECT Country,Zip FROM Zips')
Maybe, my code - sequence is wrong ?
Btw, is it correct, that AddWhere / set TMSTable.Orderfields closes the dataset and i have manually to reopen it (it's not a problem if i know, but i can't find any hints for that in documentation)
Thanks for Advice
Tino
i have a Problem :
TMSQuery / TMSTable, SDAC 3.70.0.23, Delphi 2006
....
q_zip.sql:='SELECT Country,Zip FROM Zips'
...
q_zip.Close
q_zip.DeleteWhere
q_zip.AddWhere('Country='''D''')
q_zip.Open
DeleteWhere does'nt clear the where - condition.
If i set Debug=true, then i see
1. 'SELECT Country,Zip FROM Zips WHERE Country = ''D'' '
2. 'SELECT Country,Zip FROM Zips WHERE (Country = ''D'') AND Country = ''D'' '
'
and so on.
The where clause persist (but the BaseSql property remains ' 'SELECT Country,Zip FROM Zips')
Maybe, my code - sequence is wrong ?
Btw, is it correct, that AddWhere / set TMSTable.Orderfields closes the dataset and i have manually to reopen it (it's not a problem if i know, but i can't find any hints for that in documentation)
Thanks for Advice
Tino