Exclusive connection on Firebird

Asked

Viewed 53 times

0

I am having a problem in production environment, because my application is trying to access exclusive form the database and precise circumvent this problem. In debug this did not happen.

Returning the error:

'I/O error During "Createfile (open)" Operation for file "C: DB.FDB TEST" Error while trying to open file The file is already being used by another process. '.

Basically I already know that this is a feature of using the FDCLIENT embedded according to this documentation.

Link

But I need to get around it and I know it’s possible.

Follows the code that calls the connection from a file. INI

var
  vArquivo :TiniFile;
  caminho: String;
  user: String;
  pass: String;
  charset: String;
  DriverId : String;
  server: String;
  porta : String;
  tcp :String;
begin
 
 
  arquivo:=  ExtractFilePath(ParamStr(0));
  arquivo:= arquivo + 'Ideiasp.ini';
  FDConexao.Params.clear;
  FDConexao.Connected:= FALSE;
  FDConexao.Params.Clear;
  {Carregameto do dados de parametro}
  vArquivo:= TIniFile.Create(arquivo);
  caminho:= vArquivo.ReadString('CONEXAO','DATABASE',caminho);
  user:= vArquivo.ReadString('CONEXAO','USERNAME',user);
  pass:= vArquivo.ReadString('CONEXAO','PASSWORD',pass);
  charset:= vArquivo.ReadString('CONEXAO','CharacterSet',charset);
  DriverId := vArquivo.ReadString('CONEXAO','DriverID',DriverId);
  server := vArquivo.ReadString('CONEXAO','Server',server);
  porta :=  vArquivo.ReadString('CONEXAO','Porta',porta);
  tcp:='TCPIP';
  VIdTabela := vArquivo.ReadString('TABELA','IdTabela',VIdTabela);

  
  FDConexao.Params.Values['Database']:= caminho;
  FDConexao.Params.Values['User_Name']:= user;
  FDConexao.Params.Values['Password']:= pass;
  FDConexao.Params.Values['CharacterSet']:= charset;
  FDConexao.Params.Values['DriverID']:= DriverId ;
  FDConexao.Params.Values['Server']:= server;
  FDConexao.Params.Values['Protocol']:= tcp;
  FDConexao.Params.Values['Pooled']:= 'false';
  FDConexao.Params.Values['SQLDialect']:= '3';
  FDConexao.Params.Values['GUIDEndian']:= 'Little';
  FDConexao.Params.Values['ExtendedMetadata']:='false';
  FDConexao.Params.Values['OpenMode']:= 'Open';
  FDConexao.Params.Values['CharLenMode']:= 'Chars';
  FDConexao.Connected:= TRUE;

Please help me to make my code work better, thank you

No answers

Browser other questions tagged

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