请教一个数据库问题
我新建了一个工程。它的project manager如图所示。
其中主窗体FormCover的代码如下:
unit Cover;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,DB,ADODB,StdCtrls, ExtCtrls;
type
TFormCover = class(TForm)
Label1: TLabel;
Label2: TLabel;
Panel1: TPanel;
Panel2: TPanel;
BTNAdd: TButton;
BTNBrowser: TButton;
BTNSearch: TButton;
BTNContact: TButton;
BTNAbout: TButton;
ExitBTN: TButton;
Memo1: TMemo;
procedure BTNAddClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormCover: TFormCover;
uses DataModule,AddData,Search,AddMore,About,QReport;
implementation
{$R *.dfm}
procedure TFormCover.BTNAddClick(Sender: TObject);
begin
datamodule1.//这里无法输入,因为输入这个点后就会出错。Unable to invoke Code Completion due to errors in source code
end;
end.
我的数据模板DataModule的代码如下。其中的ADOConnection1已经和数据库连接上了。好像这段代码少了点,因为我看书上说,adoconnection连接上后,在这里会生产很大一段代码。
unit DataModule;
interface
uses
SysUtils, Classes, DB, ADODB;
type
TDataModule1 = class(TDataModule)
ADOConnection1: TADOConnection;
ADODataSet1: TADODataSet;
DataSource1: TDataSource;
private
{ Private declarations }
public
{ Public declarations }
end;
var
DataModule1: TDataModule1;
implementation
{$R *.dfm}
end.