Board index » delphi » Creating a Access Database

Creating a Access Database

Hi people,

i would like to create a Access Database (test.mdb) with the
BDE MSAccess - Driver when my program starts up.

Can you help me?

Thanks

Klaus Meins  (K.Me...@muv.com)

 

Re:Creating a Access Database


The following code was posted by another user.  I have not tried it.

...............cut here ......................
const
  dbLangGeneral = $0409; {default language, English and related}

  {version and encryption options}
  dbVersion10 = 1;
  dbEncrypt = 2;
  dbDecrypt = 4; {only used when packing}
  dbVersion11 = 8;
  dbVersion20 = 16;
  dbVersion30 = 32; {choose this for Access 95 database}

procedure CreateJetDatabase(const FileName: string;
  Locale: integer; options: integer);
var
  DBEngine: Variant;
  Workspace: Variant;
begin
  DBEngine := CreateOleObject('DAO.DBEngine');
  Workspace := DBEngine.Workspaces[0];
  Workspace.CreateDatabase(Filename, $409, Options);
end;

Bill

(Sorry but TeamB cannot answer support questions received via email.)
(To send me email for any other reason remove .nospam from my address.)

Re:Creating a Access Database


Check out TMetadata comp at http://www.ems.ru/~timur/

Klaus Meins <101322.1...@compuserve.com> wrote in article
<69ssen$g...@forums.borland.com>...

Quote
> Hi people,

> i would like to create a Access Database (test.mdb) with the
> BDE MSAccess - Driver when my program starts up.

> Can you help me?

> Thanks

> Klaus Meins  (K.Me...@muv.com)

Other Threads