PDA

View Full Version : creating access db


garwain
08-27-2001, 06:27 AM
I have a program that I have written that works with an access database, using ADO controls and the Jet dbEngine.

Now I want to create the database through code. Making tables isn't a problem, I just need to know how to go about creating the MDB file itself.

Thanks

MrBaseball34
08-28-2001, 11:48 AM
You can create a .mdb file if you import the ADOX type
library and use code like this.

uses ...,ADOX;

var
ADOXCataolog:TCatalog;
begin
ADOXCataolog:=TCatalog(nil);
try
ADOXCatalog.Create1('Provider=Microsoft.Jet.OLEDB. 4.0;Data Source=new.mdb');
finally
ADOXCataolog.free;
end;

or follow one of these tutorials:
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=15292

http://delphi.about.com/library/weekly/aa072401a.htm