我很郁闷,Unit13在编译时没错,我想写Form13.OnShow事件,当我在事件里写到Form13.一点时就出错.不知是什么原因.我不写Form13.直接写ADOQuery1.也出错,写self.也出错.错误代码如下:[Pascal Error] Unit13.pas(1): Unable to invoke Code Completion due to errors in source code
附上Unit13的程序:
unit Unit13;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, StdCtrls, DB, ADODB;type
  TForm13 = class(TForm)
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    DBGrid1: TDBGrid;
    DBGrid2: TDBGrid;
    ADOConnection1: TADOConnection;
    Label1: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    ADOQuery1: TADOQuery;
    ADOQuery2: TADOQuery;
    DataSource1: TDataSource;
    DataSource2: TDataSource;
    procedure Button1Click(Sender: TObject);  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form13: TForm13;implementation{$R *.dfm}procedure TForm13.Button1Click(Sender: TObject);
begin
if (edit1.Text ='') then
showmessage('请输入车位编号!')
else
begin
  form13.ADOQuery2.Close ;
  form13.ADOQuery2.SQL.Clear ;
  form13.ADOQuery2.SQL.Add('select * from 停车场数据表 where 车位编号='+quotedstr(edit1.Text));
  form13.ADOQuery2.Open ;
end
end;end.谁能解决一下.谢谢!~

解决方案 »

  1.   

    我遇到过这种问题,你检查一下有没有什么地方标点符号或其他格式是错误的。
      

  2.   

    编译的能过的 话
    加 断点 1步1步执行.
      

  3.   

    我按你的给的代码试了,没有问题,能自动出来上下文这种事情我遇到过,可能是我不是那么认真吧,一般能编译通过我就不管他了
      

  4.   

    另外说句题外话,最近可能是毕业生生们要交毕业设计了,最近这种帖子好像格外多哦
      

  5.   

    晕,虽然有错误提示,但不理它继续写下去,写完再编译就没问题 .是软件问题还是系统问题还是我之前写的代码就出问题?