Page 1 of 1

FW_OpenAdoConnection question

Posted: Tue Oct 20, 2020 6:21 am
by damianodec
Hi,
I need to open two Ado connections.
I open first Ado oCn1 and then oCn2.
When I close oCn1 in the next oRs := FW_OpenRecordSet( oCn2, cSql, 1 ) I get error:
Time from start: 0 hours 0 mins 13 secs
Error occurred at: 20-10-2020, 08:09:26
Error description: Error ADODB.RecordSet/6 DISP_E_UNKNOWNNAME: _ACTIVECONNECTION
Args:
[ 1] = O ADODB.Connection

Stack Calls
===========
Called from: => TOLEAUTO:_ACTIVECONNECTION( 0 )
Called from: .\source\function\ADOFUNCS.PRG => FW_OPENRECORDSET( 409 )


this is my code:

Code: Select all

local oCon1
local oCon2
local cString := "..." <-data of connection (server, user password...)
local cSql
local oRs
...
Connect(cString ,@oCn1)
Connect(cString ,@oCn2)
...
oCn1:Close()

cSql = "Select * from table1"
oRs := FW_OpenRecordSet( oCn2, cSql, 1 )
...

***************************
FUNCTION Connect(cConnessione,oCn)
***************************
local lOk := .t.

oCn := FW_OpenAdoConnection( cConnessione, .t.)

if oCn = Nil
    msginfo("Error...")
    lOk := .f.
endif

Return lOk
 
any help?
thanks