请用Delphi安装盘上的InstallShield做BDE安装盘 Delphi3的和Delphi5带的好用
另外别名应程序中自动创建

解决方案 »

  1.   

    BDE安装盘我没做成
    能不能给出一个创建别名的实例,多谢!
      

  2.   

    配置别名的程序代码:asl := Tstringlist.Create ;
      asl.Clear ;
      asl.Add ('Driver Name= MSSQL');
      asl.Add ('Server Name= ' + servername);
      asl.Add ('Database Name= ' + Databasename);
      asl.Add ('User Name= ' + Username);
      asl.Add ('sqlqrymode=local');  if not Session.IsAlias ('STJ') then
      begin
      try
        Session.AddAlias ('STJ','MSSQL',ASL);
      finally
        asl.Free ;
      end;
    end 
      else if Session.IsAlias ('STJ') then
      begin
        try
          Session.ModifyAlias ('STJ',ASL);
        finally
          asl.Free ;
        end;
      end;with Datamodule.dataBase1 do
    begin
      iF Connected = true then
        Connected := false;
        aliasname := 'STJ';
        params.Clear ;
        params.Add ('server name=' + servername);
        params.Add ('database name=' + Databasename);
        params.Add ('user name=' + loginname);
        params.Add ('password=' + loginword);
        loginprompt := false;
        keepconnection := true;    try
          Connected := true;
        except
          application.MessageBox (pchar('无法启动数据库,请检查数据服务器是否已经启动!'),Pchar('错误'),mb_ok);
          application.Terminate ;
          exit;
        end;
    end;配置BDE注册的代码:
    procedure InitBde;
    var
       DataDirectory : string;
       ARegistry     : TRegistry;
    begin
      DataDirectory := ExtractFilePath( Application.ExeName );
      DataDirectory := DataDirectory+'bde\';
      ARegistry     := TRegistry.Create;
      with ARegistry do    {创建一个TRegistry对象实例  }
      begin
        RootKey := HKEY_LOCAL_MACHINE;{指定根键为HKEY_LOCAL_MACHINE}
        if not OpenKey( 'Software\Borland\BLW32', False ) then
        begin
    //      showmessage('key 1'); {写入BDE语言驱动程序所在的目录,即当前程序目录   }
          OpenKey( 'Software\Borland\BLW32', True );
          WriteString( 'BLAPIPATH', DataDirectory );
        end;
        CloseKey;    {关闭主键,同时将信息写入注册表}
        RootKey := HKEY_LOCAL_MACHINE;
        if not OpenKey('Software\Borland\Database Engine',False) then
        begin
    //      showmessage('key 2');
          OpenKey('Software\Borland\Database Engine',True);
          WriteString( 'DLLPATH', DataDirectory );
        end;
        CloseKey;    {关闭主键,同时将信息写入注册表}
        Destroy;     {释放内存  }
      end;
    end;
      

  3.   

    能不能做个BDE的安装盘给我?