unit Unit2;

interface

uses
  SysUtils, Classes, ADODB, DB;

type
  TdatDataSets = class(TDataModule)
    ADOConnection1: TADOConnection;
    ADOQuery1: TADOQuery;
    ADOTable1: TADOTable;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  datDataSets: TdatDataSets;

implementation

{$R *.dfm}

procedure TdatDataSets.DataModuleCreate(Sender: TObject);
var
	SourceStr: string;
begin
  SourceStr := ExtractFilePath(ParamStr(0)) + '..\data\dbdemos.mdb';
  ADOConnection1.Close;
  ADOConnection1.ConnectionString :=	'Provider=Microsoft.Jet.OLEDB.4.0;' +
  																		'User ID=Admin;' +
                                      'Data Source=' + SourceStr + ';' +
                                      'Mode=ReadWrite;Extended Properties="";' +
                                      'Jet OLEDB:System database="";' +
                                      'Jet OLEDB:Registry Path="";' +
                                      'Jet OLEDB:Database Password="";' +
                                      'Jet OLEDB:Engine Type=5;' +
                                      'Jet OLEDB:Database Locking Mode=1;' +
                                      'Jet OLEDB:Global Partial Bulk Ops=2;' +
                                      'Jet OLEDB:Global Bulk Transactions=1;' +
                                      'Jet OLEDB:New Database Password="";' +
                                      'Jet OLEDB:Create System Database=False;' +
                                      'Jet OLEDB:Encrypt Database=False;' +
                                      'Jet OLEDB:Don' + Char(39) + 't Copy Locale on Compact=False;' +
                                      'Jet OLEDB:Compact Without Replica Repair=False;' +
                                      'Jet OLEDB:SFP=False';
  ADOConnection1.Open;
end;

end.
