小弟初学delphi,买来的教材上没有细讲ADO,试用时遇到这个问题:
TQuery有UpdateSQL,可是TADOQuery我却不知道该把insert,delete,update的sql写在哪里。另外,TQuery通过把CachedUpdate设成true来采用缓冲区,可是TADOQuery呢?
问的很菜,不要见笑。
TQuery有UpdateSQL,可是TADOQuery我却不知道该把insert,delete,update的sql写在哪里。另外,TQuery通过把CachedUpdate设成true来采用缓冲区,可是TADOQuery呢?
问的很菜,不要见笑。
TADOQuery.sql.add('delete');
TADOQuery.sql.add('update');
TADOQuery.open;
execsql,没有返回结果的就是要用execsql了
缓冲区真的那样设置吗?
try
adoconnection1.BeginTrans;
adoquery1.UpdateBatch;
adoconnection1.CommitTrans;
except
adoquery1.CancelBatch;
adoconnection1.RollbackTrans;
end;
那就干脆所有对数据库的操作就全用SQL语句...