Re: Creating a MS Access database
From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 05/26/04
- Next message: Andrew: "Re: ADO slower than BDE"
- Previous message: Brian Bushay TeamB: "Re: Simple TADOQuery is not live"
- In reply to: Denis: "Creating a MS Access database"
- Next in thread: Denis: "Re: Creating a MS Access database"
- Reply: Denis: "Re: Creating a MS Access database"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 25 May 2004 20:37:10 -0500
>I would like to create a new MDB file with some tables. I have never done
>this before, so I wonder what steps should I follow.
If you import the ADOX type library you can use code like this to create an
access database.
var
Catalog: _Catalog;
CS,dbName: string;
begin
dbName := 'myNewAccessDB6.mdb';
Catalog := CreateCOMObject(StringToGUID('ADOX.Catalog')) as _Catalog;
CS := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + dbName
// Engine type = 5 creates 2000 database
+';Jet OLEDB:Engine Type=5';
if FileExists(dbName) then
DeleteFile(dbName);
Catalog.Create(CS);
Catalog := nil;
end;
-- Brian Bushay (TeamB) Bbushay@NMPLS.com
- Next message: Andrew: "Re: ADO slower than BDE"
- Previous message: Brian Bushay TeamB: "Re: Simple TADOQuery is not live"
- In reply to: Denis: "Creating a MS Access database"
- Next in thread: Denis: "Re: Creating a MS Access database"
- Reply: Denis: "Re: Creating a MS Access database"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|