第一个问题:应当是不可以的,除非你用两个query并设置同步,这样可以通过获取第一个query的指针位置从而定位第二个query的指针。
第二个问题:应当可以。参照记录类型的定义,如:type
  slonday = record
  day: cardinal;
  Oprice: cardinal;
  Cprice: cardinal;
  Hprice: cardinal;
  Lprice: cardinal;
  Damout: cardinal;
  Dvolmn: cardinal;
  reserved: Array[0..5] of smallint;
end;Vsday : Slonday;
这样定义之后,还可以实现把数据写入到文件中去

解决方案 »

  1.   

    我的目的是在数据录入时可以实现将数据从上一条记录copy下来。两个query加大了系统开销不要取第二个方案也不可取因为一个系统有无数个query,程序会变得很长、很长。也不可取
      

  2.   

    完全沒什么﹐而且已有比較好的程序代碼﹐無須為每個字段定義一個變量這樣麻煩﹐
    大概我可以明天﹐copy一份粘貼上來
      

  3.   

    勤桶笢暮翹輛俴葩秶珨楊
          
      婓剒猁勤桶氝樓珨隅杅醴腔暮翹ㄛ甜暮翹潔腔囀硐衄竭苤曹趙奀祥溥妏蚚狟醱腔滲杅﹝
          {************************************************
    // procedure AppendCurrent
    //
    // Written By: Steve Zimmelman
    // 6/4/96
    //
    // Version: Delphi 2.0
    //
    // Will append an exact copy of the current 
    // record of the dataset that is passed into 
    // the procedure and will return the dataset 
    // in edit state with the record pointer on 
    // the currently appended record.
    ************************************************}
    Procedure AppendCurrent(Dataset:Tdataset);
    Var
      aField : Variant ;
      i      : Integer ;
    Begin
      //Create a variant Array
      aField := VarArrayCreate(
                   [0,DataSet.Fieldcount-1],
                                 VarVariant);
      // read values into the array
      For i := 0 to (DataSet.Fieldcount-1) Do Begin
         aField[i] := DataSet.fields[i].Value ;
      End;
      DataSet.Append ;
      // Put array values into new the record
      For i := 0 to (DataSet.Fieldcount-1) Do Begin
         DataSet.fields[i].Value := aField[i] ;
      End;
    End;