procedure TSDIAppForm.CreateMDB(DBName: string); // 系统需要安装 MADAC var CreateAccess: OleVariant; begin CreateAccess := CreateOleObject('ADOX.Catalog'); CreateAccess.Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + DBName); end;
procedure TSDIAppForm.DataModuleCreate(DBName:string); var sdir,sfile :string; ssql:string; begin if not FileExists(DBName) then begin//1 try CreateMDB(DBName); except ShowMessage('数据库创建失败!'); Exit; end; SplitPath(DBName,FenJiePath); sdir:=FenJiePath.pathxie ;
sfile :=sdir+'Sys\alert'; if FileExists(Sfile) then DeleteFile(Sfile);
sfile :=sdir+'Sys\alertid'; if FileExists(Sfile) then DeleteFile(Sfile);