Создать базы данных Access
Оформил: DeeCo
Автор: http://www.swissdelphicenter.ch
// Using ADOX:
uses
ComObj;
// You can with ADOX (Microsoft ADO Extensions for DDL and Security),
function CreateAccessDatabase(FileName: string): string;
var
cat: OLEVariant;
begin
Result := '';
try
cat := CreateOleObject('ADOX.Catalog');
cat.Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + FileName + ';');
cat := NULL;
except
on e: Exception do Result := e.message;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
CreateAccessDatabase('c:\Testdb.mdb');
end;
|