Архив метки: Workspace

Функция создания Базы Данных (Access)

[cc lang=”delphi” tab_size=”2″ line_numbers=”false” no_links=”false”] // uses comobj; function CreateDatabase(DatabaseName: string): boolean; var DBEngine, Workspace: Variant; const dbLangGeneral = ‘;LANGID=0x0409;CP=1252;COUNTRY=0’; dbVersion30 = 32; begin result := false; try try DBEngine := CreateOleObject(‘DAO.DBEngine.36’); except try {For DAO 3.5} DBEngine := CreateOleObject(‘DAO.DBEngine.35’); except raise; end; end; Workspace := DBEngine.Workspaces[0]; try Workspace.CreateDatabase(DatabaseName, dbLangGeneral, dbVersion30); except on e0: EOleException… Читать далее »