L
lixx
Unregistered / Unconfirmed
GUEST, unregistred user!
Access数据库97与D6
有一表如下结构:
Name Quality
A 11
B 22
.. ..
其中:
Name : 字符串型(长度为1)
Quality:字符串型(长度为2)
我用Query作如下查询出错:
with query1 do
begin
Close;
Sql.clear;
Sql.add('select * from mytable where Name="A" ');
Open;
end;
但如下查询即可:
with query1 do
begin
Close;
Sql.clear;
Sql.add('select * from mytable where Name=:QueryName ');
Parambyname('QueryName').asString:='A';
Open;
end;
为什么????
有一表如下结构:
Name Quality
A 11
B 22
.. ..
其中:
Name : 字符串型(长度为1)
Quality:字符串型(长度为2)
我用Query作如下查询出错:
with query1 do
begin
Close;
Sql.clear;
Sql.add('select * from mytable where Name="A" ');
Open;
end;
但如下查询即可:
with query1 do
begin
Close;
Sql.clear;
Sql.add('select * from mytable where Name=:QueryName ');
Parambyname('QueryName').asString:='A';
Open;
end;
为什么????