P pnyexin Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-30 #1 我有一个表Table,先是向表中添加了若干条记录,我想删除第i条记录,请问用程序怎么写?谢谢
飞 飞雪轩主 Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-30 #2 道先查找出你要找的那条记录,然后Delete就行了 ADOQuery1.Close; ADOQuery1.SQL.Clear; ADOQuery1.SQL.Add(SELECT * FROM Table WHERE Field=ara); ADOQuery1.Parameters.ParamByName('Para').Value :=查询值 ADOQuery1.Open; ADOQuery1.DeleteRecords(arCurrent); //删除当前记录
道先查找出你要找的那条记录,然后Delete就行了 ADOQuery1.Close; ADOQuery1.SQL.Clear; ADOQuery1.SQL.Add(SELECT * FROM Table WHERE Field=ara); ADOQuery1.Parameters.ParamByName('Para').Value :=查询值 ADOQuery1.Open; ADOQuery1.DeleteRecords(arCurrent); //删除当前记录
S stuwei Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-31 #3 楼上的理解有误,人家问的是删第I条,不是删那一条 我用偷懒的办法 table.first; while (not table.eof ) and n<i do begin table.next; n:=n+1 end; table.delete
楼上的理解有误,人家问的是删第I条,不是删那一条 我用偷懒的办法 table.first; while (not table.eof ) and n<i do begin table.next; n:=n+1 end; table.delete
X xiaotiantian Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-31 #4 Table.First; Table.MoveBy(I-1); Tabel.Delete;
H herotjun Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-31 #5 Delete from Table where Field=ara