尝试执行代码时:
function TDBClass.addNome(nome: String): String;
var
rsnome: TADOQuery;
begin
rsnome := TADOQuery.Create(nil);
rsnome.Connection := connection;
rsnome.Open();
rsnome.SQL.Clear;
rsnome.SQL.Text:='UPDATE enroll SET nome = "test" where id ="1"';
rsnome.Parameters.ParamByName('nome').Value:= nome;
rsnome.ExecSQL;
rsnome.post();
rsnome.Close();
rsnome.Free();
end;
我收到错误消息“缺少 SQL 属性”。我哪里做错了?
提前致谢!
最佳答案
在通过 rsnome.SQL.Text := ...
设置 SQL 之前调用 rsnome.Open
。
关于delphi - 这里的 "Missing SQL property"是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8326150/