Создание базы данных Access в Delphi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
// 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; |