本人写了一个数据库备份程序,将原始数据表的记录抽取到备用数据表中,
使用insert into方法,已经实现。三个表的对应如下:
  a表 a.no=b.no and a.date=b.date  B表  C表  c.no=a.no and c.date=a.dateb表与C表为A表的明细内容,a表的一条记录分别对应B表与C表的多条记录
 抽取之后需要将指定date的a表的no进行从1到tabe.recordcount的再次排序,并同时将B表与C表中的相应记录更改为排序后的no值。
  本人使用query控件的update方法,但对BDE不熟,没有成功,请高手指点。

解决方案 »

  1.   

    for id:=1 to q_1.recordCount do
      begin
      que_id.sql.clear;
       que_id.sql.add('update allbill set exeno=:no,billno=:no');
       que_id.sql.add('where exeno=:exeno and exedate=:exedate');
       que_id.parambyname('no').asstring:=inttostr(id);
       que_id.execsql;  que_ido.sql.clear;
      que_ido.sql.add('update allorder set exeno=:no,billno:=:no');
      que_ido.sql.add('where exeno=:exeno and exedate=:exedate');
      que_ido.parambyname('no').asstring:=inttostr(id);
      que_ido.execsql;
       que_idp.sql.clear;
       que_idp.sql.add('update payment set exeno=:no');
       que_idp.sql.add('where exeno=:exeno and exedate=:exedate');
       que_idp.parambyname('no').asstring:=inttostr(id);
       que_idp.execsql;   q_1.next;
       end;这是我那个排序源码,请问错在哪里?
      

  2.   

    :exeno ,:exedate这些参数为什么不指定值呢?
      

  3.   

    datasource1指定navigator,可以直接调用当前行的值,所以没有指定:exeno ,:exedate的值