Как создать базу данных Access во время выполнения
|
procedure CreateMSAccessDB(filename : String); var DBEngine, Workspace: Variant; const {Important to use the following constant as is} dbLangGeneral = ';LANGID=0x0409;CP=1252;COUNTRY=0'; dbVersion30 = 32; begin DBEngine := CreateOleObject('DAO.DBEngine'); {DBEngine := CreateOleObject('DAO.DBEngine.35'); For DAO 3.5} Workspace := DBEngine.Workspaces[0]; try Workspace.CreateDatabase(filename, dbLangGeneral, dbVersion30); except on EOleException do ShowMessage('Database already exists'); end; end;
|