需要DataAcess,BDE中的Table或者Query,再用一个DbGrid显示数据,就可以看到数据了。

解决方案 »

  1.   

    为什么不用ADO?把参数写注册表里
    procedure TrdmUserStudy.RemoteDataModuleCreate(Sender: TObject);
    var
      regConn : TRegistry;
      strConn : String;
      sProvider : String;
      sPersist : String;
      sUserID : String;
      sPassword : String;
      sCatalog : String;
      sDS: String;
      sPrepare : String;
      sTranslate : String;
      sPacketSize : String;
      sWorkStation : String;
      sEncryption : String;
      sTag : String;
    begin
      //开始构造连接串
      //从注册表中读取连接参数
      regConn := TRegistry.Create;
      try
        regConn.RootKey := HKEY_CURRENT_USER;
        regConn.OpenKey('\Software\IEdu',False);
        sProvider := regConn.ReadString('Provider');
        sPersist := regConn.ReadString('Persist Security Info');
        sUserID := regConn.ReadString('User ID');
        sPassword := regConn.ReadString('Password');
        sCatalog := regConn.ReadString('Initial Catalog');
        sDS := regConn.ReadString('Data Source');
        sPrepare := regConn.ReadString('Use Procedure for Prepare');
        sTranslate := regConn.ReadString('Auto Translate');
        sPacketSize := regConn.ReadString('Packet Size');
        sWorkStation := regConn.ReadString('Workstation ID');
        sEncryption := regConn.ReadString('User Encryption for Data');
        sTag := regConn.ReadString('Tag with column collation when possible');
      finally
        regConn.Free;
        strConn := 'Provider=' + sProvider + ';Persist Security Info=' + sPersist + ';User ID=' +
        sUserID + ';Password=' +  sPassword + ';Initial Catalog=' + sCatalog + ';Data Source=' +
        sDS + ';Use Procedure for Prepare=' + sPrepare + ';Auto Translate=' + sTranslate + ';Packet Size=' +
        sPacketSize + ';Workstation ID=' + sWorkStation + ';User Encryption for Data=' + sEncryption +
        ';Tag with column collation when possible=' + sTag;
      end;  connMain.ConnectionString := strConn;
      connMain.Connected := True;
    end;