FW_OpenAdoConnection question

Post Reply
User avatar
damianodec
Posts: 372
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia
Contact:

FW_OpenAdoConnection question

Post 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
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Post Reply