FW_OpenAdoConnection question

FW_OpenAdoConnection question

Postby damianodec » Tue Oct 20, 2020 6:21 am

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  Expand view

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)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 53 guests