TClientDataSet does not start

0

I create at runtime a TClientDataSet , start, insert, but some computers do not start or create TClientDataSet .

Windows of my computer (Develop) Windows 7 32 bits , works perfectly.

Windows of computer where error is Windows 7 64 Bits , does not create TClientDataSet .

Does anything have to be 32 or 64 bits.

Part of 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;
    
asked by anonymous 07.07.2015 / 20:38

1 answer

0

The TClientDataSet component requires that the midas.dll library exists on the system where the program will run. Usually all development machines already have this library because it is installed together with Delphi, but it needs to be distributed along with the developed application.

If you do not want to distribute the library, you can dispense with its use simply by including in the uses clause of your project (dpr) the 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, it dispenses its distribution

    
20.10.2016 / 21:07