还有200分在:
http://community.csdn.net/Expert/topic/4079/4079049.xml?temp=.559765
http://community.csdn.net/Expert/topic/4079/4079059.xml?temp=.5203974
http://community.csdn.net/Expert/topic/4079/4079049.xml?temp=.559765
http://community.csdn.net/Expert/topic/4079/4079059.xml?temp=.5203974
Project Project1.exe raised exception class EOleException with message 'Parameter 对象被不正确地定
义。提供了不一致或不完整的信息。'.Process stopped.Use Step or Run to continue.难道是delphi的Bug!!!
因此我建议,除了对SQL语句进行检验外,还要测试其他各种环境,比如操作系统,连接方式等其他看似无关的场合
你认为没有问题的地方不一定就没有问题,要不然就不会出错了
var
delstr, insertstr: string;
begin
delstr := 'delete from fxa_card where cAstCode=''1`1 '''; insertstr := 'insert into fxa_card(cAstCode,cAstName,cManufacture,cStyle,nDeptID,cSite,dStartDate';
insertstr := insertstr + ') ';
insertstr := insertstr + ' values(''1`1 '',''SDFSDF '',';
insertstr := insertstr + '''富奥汽车零部件 '',''HHHHHHHHHH '',405,';
insertstr := insertstr + ''' '',''2001-07-31 00:00:00''';
insertstr := insertstr + ')'; ADOQuery1.Active := False;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add(delstr);
try
ADOQuery1.ExecSQL;
showmessage('删除成功!');
except
end; ADOQuery1.Active := False;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add(insertstr);
Memo1.Text := ADOQuery1.SQL.Text;
try ADOQuery1.ExecSQL;
showmessage('插入成功!');
except
end;
end;似乎问题出在“`”上,因为如果把“`”换成其他的字符 的话,不报错,数据也能成功插入数据库但是语句1、2、3也都含有“`”,程序也不报错,数据也能成功插入数据库to 楼上各位:
把“`”换成其他的字符,正常运行,数据也能成功插入数据库