ADOでパラメーター化されたクエリを使用しようとしています。オブジェクトを実行するとCommand
、エラーがスローされます。
変数'@filename'を宣言する必要があります
私は以下@filename
を使用してパラメータを宣言しますCreateParameter/Append
:
sql := 'INSERT INTO Sqm(Filename, data) VALUES(@filename, @data)';
command := CoCommand.Create;
command.Set_ActiveConnection(Connection.ConnectionObject);
command.Set_CommandText(sql);
command.Set_CommandType(adCmdText);
command.Parameters.Append(Command.CreateParameter('@filename', adLongVarWChar, adParamInput, -1, Filename));
command.Parameters.Append(Command.CreateParameter('@data', adLongVarWChar, adParamInput, -1, xml);
command.Execute({out}recordsAffected, EmptyParam, adCmdText or adExecuteNoRecords);
私は何が間違っているのですか?