tempid := adorecievequery.fieldbyname('SM_ID').AsInteger;...
为什么执行如下语句出错??
adorecievequery.SQL.Text:='update dbo.tbl_SMReceived set readed=1 where SM_ID = tempid '
adorecievequery.ExecSQL; SM_ID字段是整形 int where SM_ID = tempid 应该如何写才对?
为什么执行如下语句出错??
adorecievequery.SQL.Text:='update dbo.tbl_SMReceived set readed=1 where SM_ID = tempid '
adorecievequery.ExecSQL; SM_ID字段是整形 int where SM_ID = tempid 应该如何写才对?
tempid := adorecievequery.fieldbyname('SM_ID').AsInteger;
with adorecievequery do
begin
close;
SQL.Text:='update dbo.tbl_SMReceived set readed=1 where SM_ID = :tempid ';
Parameters.parambyname('tempid').value := tempid;
ExecSQL;
begin
close;
sql.text := ' insert into t1(c1,c2) values(:c1,:c2)';
parameters.parambyname('c1').value := '';
....
execsql;
end;查询和你的update差不多.
这里的:c1,:c2名称可以随便命名的