DB.CloneConnection

Top  Previous  Next

 

Syntax

function DB.CloneConnection(Con: pointer): pointer

 

Alternative Names

ibec_CloneConnection

 

Description

Creates a copy of available connection Con.

 

Returns NULL in case of an exception, a connected Connection-object if it succeeds.

 

See Also

DB.CreateConnection
DB.CloseConnection
DB.UseConnection

 

Example

execute udsblock

as

begin

  connectstr = 'database=server_fb:c:\data\testdb.fdb;username=SYSDBA;password=masterkey;

                client_library=C:\Program Files (x86)\Firebird\Firebird_4_0\fbclient.dll';

 

  FBCon = DB.CreateConnection(__ctFirebird, connectstr);

 

  /* clone connection */

  FBCon_Cloned = DB.CloneConnection(FBCon);

 

  /* close original connection */

  DB.CloseConnection(FBCon);

 

  DB.UseConnection(FBCon_Cloned);

  try

    /* perform queries on the cloned connection */

  finally

    DB.CloseConnection(FBCon_Cloned);

  end

end