Result := False;
try
mADOQuery.Close;
mADOQuery.ConnectionString := Format(
''Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s%s.mdb'',
[ExtractFilePath(Application.ExeName), mDatabaseName]);
mADOQuery.SQL.Text := ''CREATE TABLE Table1 (Field1 varchar(10), Field2 varchar(10))'';
mADOQuery.ExecSQL;
except
Exit;
end;
Result := True;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
DeleteFile(ExtractFilePath(Application.ExeName) + ''test.mdb'');
CreateDatabase(''test'');
CreateTable(''test'', ADOQuery1);
end;