ERRO AO COMPILAR PROJETO DELPHI 7 NO XE2

Delphi

25/08/2012

Olá!
Adquiri uma licença do Rad studio XE2 e estou tentando rodar um projeto em Delphi 7 mas está me dando algumas mensagens.
Algumas consegui contornar.
Uso no Delphi 7 o DBXexpress...

try
Transacao.TransactionID := itransacao;
Transacao.IsolationLevel := xilREPEATABLEREAD;
dmbd1.SQLConn1.StartTransaction(Transacao);
dmbd12.SQLDSctmovimento.Close;
dmbd12.SQLDSctmovimento.CommanType := ctQuery; //aqui da o erro no Uctmovimento.pas
E2003: Undeclared identifier: 'CtQuery'
// o datamodule Udmbd12 está declarado na uses

dmbd12.SQLDSctmovimento.CommandText := 'INSERT into ctmovimento('+ .......
....

// Aí achei esquisito... ou existe incompatibilidade com o XE2, assim, dessa maneira, tentando migrar direto?

Att
Jose Guerin

Jose Guerin

Curtidas 0

Respostas

Marco Salles

Marco Salles

25/08/2012

muitas coisas mudaram

O Controle Transactional foi um deles

uses
DBXCommon;

var
tr:TDBXTransaction;
begin
//nivel de isolamento..
  tr:=dmbd1.SQLConn1.DBXConnection.BeginTransaction(TDBXIsolations.ReadCommitted);
  try
  
    dmbd12.SQLDSctmovimento.Close;
    dmbd12.SQLDSctmovimento.CommandType:= ctQuery; //aqui da o erro no Uctmovimento.pas

    dmbd12.SQLDSctmovimento.CommandText := 'INSERT into ctmovimento('+ 'Bla bla bla';

     dmbd1.SQLConn1.CommitFreeAndNil(tr);
  finally
      dmbd1.SQLConn1.RollbackIncompleteFreeAndNil(tr);
  end;
end;
GOSTEI 0
POSTAR