The unit datam;
Interface
USES the
SysUtils, Classes, DB, ADODB, Dialogs;
Type
Tdm=class (TDataModule)
Dsstu: TDataSource;
Student: TADOQuery;
Dstea: TDataSource;
The teacher: TADOQuery;
Dscou: TDataSource;
Course: TADOQuery;
Banji: TADOTable;
Xuesheng: TADOTable;
DSXSBB: TDataSource;
Jiaoshi: TADOTable;
Yixuan: TADOQuery;
Suoyou: TADOQuery;
Dsyixuan: TDataSource;
Dssuoyou: TDataSource;
Dsxuanke: TDataSource;
Xuanke: TADOQuery;
Wodexinxi: TADOQuery;
DSWDXX: TDataSource;
Con1: TADOConnection;
Procedure DataModuleCreate (Sender: TObject);
Private
{Private declarations}
Public
{Public declarations}
end;
Var
Dm: Tdm;
Implementation
{$R *. DFM}
Procedure Tdm. DataModuleCreate (Sender: TObject);
The begin
Try
Dm. Con1. The ConnectionString:='. The Provider=Microsoft Jet. The OLEDB. 4.0; Password=""; Data Source='+ ExtractFilePath (Paramstr (0)) +' stu. MDB. Persist Security Info=True ';
Dm. Con1. Connected:=true;
Dm. Con1. Close;
Dm. Con1. Open;
Showmessage (' connection database successful ');
Except,
Showmessage (' database connection error);
end;
end;
End.
After the static database connection to delete, move to somewhere else is wrong