代码如下:
with ADOQuery1 do
begin
close;
sql.Clear;
sql.Add('select source,money,date,note from gz where type="in"');
open;
end;
若把where type="in"去掉,则不会出现错误!
...全文
43612打赏收藏
Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 1 ??!!
代码如下: with ADOQuery1 do begin close; sql.Clear; sql.Add('select source,money,date,note from gz where type="in"'); open; end; 若把where type="in"去掉,则不会出现错误!
slzzg(懒虫)说的基本没错,只是不是因为Delphi不支持双引号作为字符引起的,而是因为odbc for access 不支持双引号作为字符引起的,改用ado没问题
如果用access数据库,最好用ado,一是因为odbc是较老的数据引擎,二是delphi用odbc是通过bde的,在其它机上运行要将bde一起打包安装,而ado不用