Tclientdataset does not start

Asked

Viewed 217 times

0

I create at runtime a TClientDataSet, start, do Insert, but in some computers does not start or create the TClientDataSet.

Windows from my computer (Desenv) Windows 7 32 bits, works perfectly.

Windows computer where the error appears Windows 7 64 Bits, does not create the TClientDataSet.

Does it have anything relative to being 32 or 64 bits.

Part of the code:

if  dmPedido.cdsConexao.Active = false then
    dmPedido.cdsConexao.CreateDataSet;
dmPedido.cdsConexao.EmptyDataSet; 


procedure TfrmTransmissao.MontaSequenciaConexao(fConexao:string);
var
    sParte,sParte2 : String;
    iInicio, i : Integer;
    //Definindo a entrada
    n: integer; //Conexao a ser utilizada
    S: String;  //Tipo do serviço
    E: String;  //Empresa
    p: integer; //Prioridade

procedure InsereItemTamporario (sEmp:Integer; sEnd:String; iPrior:Integer; sTpSer:String; iSeq:Integer);
begin
    try
        dmPedido.cdsConexao.Insert;
        dmPedido.cdsConexaoEmpresa.AsInteger    := sEmp;
        dmPedido.cdsConexaoEndereco.AsString    := sEnd;
        dmPedido.cdsConexaoPrioridade.AsInteger := iPrior;
        dmPedido.cdsConexaoTipoServico.AsString := sTpSer;
        dmPedido.cdsConexaoSequencia.AsInteger  := iSeq;
        dmPedido.cdsConexao.Post;
    except
        On e:Exception do
            WriteLogr('Erro ao inserir na tabela "cdsConexao". '+e.Message);
    end;
end;
begin
    sParte := fConexao;
    sParte2:= fConexao;
    iInicio := 0;
    i:=1;
    p:=0;
    sParte:= Copy(fConexao,iInicio,4);
    sParte2:=fConexao;
    try
            if  dmPedido.cdsConexao.Active = false then
                dmPedido.cdsConexao.CreateDataSet;
            dmPedido.cdsConexao.EmptyDataSet;
    Except
        on e:Exception do
            WriteLogr('Erro ao criar a tabela  temporária de conexão  '+e.Message);
    end;
    if (fConexao<>'') then
    begin
        repeat
            sParte2:=Copy(sParte2,6,length(sParte2));
            n := StrToInt(sParte[1]);
            S := sParte[2];
            E := sParte[3];
            p := StrToInt(sParte[4]);
            try
                InsereItemTamporario(StrToInt(E), sDNS[n], p, S, i);
            except
                on e:Exception do
                    WriteLogr('Erro ao inserir na tabela de conexão '+e.Message);
            end;
            sParte:= Copy(sParte2,iInicio,4);
            Inc(i)
        until sParte = '';
     end
     Else begin
          If dmPedido.tbCDs.Locate('CD_PRIN', 'CWB',[]) Then
          begin
              InsereItemTamporario(1, dmPedido.tbCDsCONEXAO1.AsString, 1, 'H', 1); //é o mesmo que dmPedido.tbCDsIP_WWW
              InsereItemTamporario(1, dmPedido.tbCDsCONEXAO2.AsString, 1, 'F', 2); //é o mesmo que dmPedido.tbCDsIP_WWW2
              InsereItemTamporario(1, dmPedido.tbCDsCONEXAO3.AsString, 2, 'F', 3); // e Contingencia sempre será ftp
     end
     else
          InsereItemTamporario(1, sDNS[2], 1, 'F', 1);
        //Para o caso da tabela estar vazia!
 end;
  • Excuse me 'the error is presented', the correct is 'where the error occurs'.

  • Are all dependencies on the machine where the error occurs? How is the DBMS on these machines?

  • There is no sgbd, it is table even.... create a temporary table, with items to connect to multiple items like dns address, connection type (FTP or HTTP) user and connection precedence

  • @Luizvichiatto, you are doing the Createdataset, before entering the temporary data?

  • @Luizvichiatto, put the code here, so we can see how you are creating the Clientdataset

  • @Wellingtonsilvaribeiro It follows part of the code, I edited the question, I could not put in the comment (juvenile hehehe)

  • @Luizvichiatto, this passage doesn’t say much, what event are you creating and what data are you filling out? Nomally Createdataset is used in the Oncreate event or in some boot method.

  • @Wellingtonsilvaribeiro, I found out what it is, the problem is opening the DLL Midas.dll, I don’t know what’s wrong but in the installation it’s not up to date with the one I’m using in development.

Show 3 more comments

1 answer

0

The Tclientdataset component requires the library Midas.dll exists on the system where the program will be executed. Normally all development machines already have this library because it is installed together with Delphi, but it is necessary to distribute it together with the developed application.

If you do not want to distribute the library, you can dispense with its use by simply including in the uses clause of your project (dpr) to Unit Midaslib. This Unit (compiled into a dcu) encapsulates the functions that would be executed by Midas.dll and therefore, by including it as indicated, dispenses with its distribution

Browser other questions tagged

You are not signed in. Login or sign up in order to post.