FW_OpenAdoConnection problem with 2 connections

Post Reply
User avatar
Maurizio
Posts: 827
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

FW_OpenAdoConnection problem with 2 connections

Post by Maurizio »

Hello
I have 2 connections on 2 different server in the same time .

Code: Select all | Expand

#include 'fivewin.ch'

//-------------------------------------------------------------------------------------------
Function Main()
Local oRs ,oCn

 // here I open a connection on the  server  1
 oCn  := FW_OpenAdoConnection( { "MYSQL", "xxx.xxx.xxx.xxx", "dbname_1", "user", "pw" }, .t. )

 Test("first call")

 oRs := FW_OpenRecordSet(oCn, 'table')
 oRs:Close()

 
 Test("second call")

oCn:Close()



Return nil
Function Test(cTxt)

Local oCn2

  // here I open a connection on the  server  2
  oCn2:= FW_OpenAdoConnection( { "MYSQL", "yyy.yyy.yyy.yyy","dbname_2", "user", "pw" }, .t. )
 
  // The fist call is correct , I note in the browse : Current Catalog is  dbname_2
 
  // The second call is wrong , I note in the browse : Current Catalog is dbname_1 of the Server 1
    xBrowse(oCn2,'Server 2 :' + ctxt )

oCn2:Close()

REturn nil


Regards
Maurizio
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: FW_OpenAdoConnection problem with 2 connections

Post by nageswaragunupudi »

We are looking into this.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: FW_OpenAdoConnection problem with 2 connections

Post by nageswaragunupudi »

Fixed in FWH 1801.
Many thanks for pointing out.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Maurizio
Posts: 827
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Re: FW_OpenAdoConnection problem with 2 connections

Post by Maurizio »

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

Re: FW_OpenAdoConnection problem with 2 connections

Post by damianodec »

hI,
I have the same error,
how can I to solve it with FiveWin for xHarbour 17.09 - Sep. 2017 ?
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: 422
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia
Contact:

Re: FW_OpenAdoConnection problem with 2 connections

Post by damianodec »

hi, no news?
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
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: FW_OpenAdoConnection problem with 2 connections

Post by nageswaragunupudi »

Mr. damianodec

Please see the
function Fw_OpenAdoConnection
in \fwh\source\function\adofuncs.prg

You will find this code
lines 90 to 94

Code: Select all | Expand

//   if ( ! Empty( cSpec ) .and. cSpec == scSpec ) .or. cConnStr == scStr1 .or. cConnStr == scStr2
   if If( Empty( cSpec ), cConnStr == scStr1 .or. cConnStr == scStr2, cSpec == scSpec )
      soCn_Check()
      return soCn
   endif
 


and lines 100 to 103

Code: Select all | Expand

  if ( ! Empty( cSpec ) .and. cSpec == scSpec ) .or. cConnStr == scStr1 .or. cConnStr == scStr2
      soCn_Check()
      return soCn
   endif
 


Please comment out both.
Let me know if this works.
Regards

G. N. Rao.
Hyderabad, India
User avatar
damianodec
Posts: 422
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia
Contact:

Re: FW_OpenAdoConnection problem with 2 connections

Post by damianodec »

hi Mr. Rao,
In these days I'm out of Office, I'll try it..
thank you very much!
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