各位大虾;
   我在在运行以下程序时,系统提醒我'DataSet not in Edit
or Insert mode',我查了几遍都为查处问题。请哪为高手帮我一个忙。
以下便是经过简化的源代码:(ERP:用InterBase开发的数据库的别名。CustomerGrade:库中的一个表。)
object Form1: TForm1
  Left = 192
  Top = 112
  Width = 696
  Height = 480
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -13
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 120
  TextHeight = 16
  object DBGrid1: TDBGrid
    Left = 48
    Top = 136
    Width = 529
    Height = 129
    DataSource = DataSource1
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -13
    TitleFont.Name = 'MS Sans Serif'
    TitleFont.Style = []
  end
  object Table1: TTable
    DatabaseName = 'ERP'
    TableName = 'CUSTOMERGRADE'
    Left = 48
    Top = 80
  end
  object DataSource1: TDataSource
    DataSet = Table1
    Left = 112
    Top = 80
  end
endunit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, Grids, DBGrids, DBTables;type
  TForm1 = class(TForm)
    Table1: TTable;
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
  Table1.Active:=true;
  Table1.Last;
  Table1.FieldValues['ID']:='005';
  Table1.Post;
  Table1.Active:=false;
end;end.