Re: Creating mdb file!

From: mhb (mhb_shrf_at_hotmail.com)
Date: 12/11/03


Date: Thu, 11 Dec 2003 16:41:00 +0200

Hi,

>From the Project->Import Type Library->Microsoft ADO Ext. and rename TTable
to TADOXTable, etc..
and use this code to create the databse:

procedure TForm1.CreateDatabase(dbname: string);
var
  db: variant;
begin
  dbname := 'c:\test.mdb';
  db := CreateOleObject('ADOX.Catalog');
  try
    db.Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + dbname +
';Persist Security Info=False');
  finally
    db.Free;
  end;
end;

Regards

"Atmapuri" <janez.makovsek@usa.net> wrote in message
news:3fd87c32$1@newsgroups.borland.com...
> Hi!
>
> Is it possible to create the mdb file when the application first starts
> and then use SQL commands to create all the neccessary tables?
> All using ADO components. It seems that creating tables can be done,
> but I cant figure out if there is any way to also created the database
> itself.
>
> Thanks!
> Atmapuri.
>
>



Relevant Pages