Delphi中用ado连接IBM DB2数据库的问题(100分)

L

labafa

Unregistered / Unconfirmed
GUEST, unregistred user!
用一个ADOQuery连接到数据库。写一条sql语句,然后open。这是没问题的。但我不能修改,
我是这样修改:
ADOQuery1.Edit;
ADOQuery1.ParamByName('col1').value :='aaa';
ADOQuery1.Post;
在Post的时候就会出错。信息如下:
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EOleException with message '多步操作产生错误,请检查每一步的状态值'. Process stopped. Use Step or Run to continue.
如果ADOQuery1连接的是SQL Server数据库,就没有问题!!不知是什么原因?
 
不知是不是要装ado的补丁(我用delphi6)
 
怎么能是ParamByName??????
这个参数只是用在select/update/insert时的实时参数,
你用以下方法,绝对行。
ADOQuery1.Edit;
ADOQuery1.FieldByName('col1').asstring :='aaa';
ADOQuery1.Post;
 
是大小写的关系,一定要用大写的表名,字段名。
 
顶部