QryTmp:=TADOQuery.Create(self);
QryTmp.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+extractfilepat(application.ExeName)+'db.mdb;Persist Security Info=False';
QryTmp.Close;
QryTmp.SQL.Clear;
QryTmp.SQL.Add('select * from mudb where id = '''+js+''' ');
(js定义的String格式)
怎么总提示格式不对?? ID 是表中 自动编号的, 要怎么写这个SQL? 以自动编号的数据作为条件
QryTmp.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+extractfilepat(application.ExeName)+'db.mdb;Persist Security Info=False';
QryTmp.Close;
QryTmp.SQL.Clear;
QryTmp.SQL.Add('select * from mudb where id = '''+js+''' ');
(js定义的String格式)
怎么总提示格式不对?? ID 是表中 自动编号的, 要怎么写这个SQL? 以自动编号的数据作为条件
试试这个
js为空造成的if length(trim(js))=0 then
begin
showmessage('js无值');
exit
end else QryTmp.SQL.Add('select * from mudb where id = '+js);