Page 1 of 1

FW_OpenAdoConnection problem with 2 connections

PostPosted: Thu Feb 01, 2018 5:38 pm
by Maurizio
Hello
I have 2 connections on 2 different server in the same time .

Code: Select all  Expand view
#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

Re: FW_OpenAdoConnection problem with 2 connections

PostPosted: Thu Feb 01, 2018 7:08 pm
by nageswaragunupudi
We are looking into this.

Re: FW_OpenAdoConnection problem with 2 connections

PostPosted: Tue Feb 13, 2018 4:13 pm
by nageswaragunupudi
Fixed in FWH 1801.
Many thanks for pointing out.

Re: FW_OpenAdoConnection problem with 2 connections

PostPosted: Wed Feb 14, 2018 2:50 pm
by Maurizio

Re: FW_OpenAdoConnection problem with 2 connections

PostPosted: Wed Feb 27, 2019 9:13 am
by damianodec
hI,
I have the same error,
how can I to solve it with FiveWin for xHarbour 17.09 - Sep. 2017 ?
thanks

Re: FW_OpenAdoConnection problem with 2 connections

PostPosted: Wed Mar 06, 2019 9:22 am
by damianodec
hi, no news?

Re: FW_OpenAdoConnection problem with 2 connections

PostPosted: Thu Mar 07, 2019 7:53 am
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 view
//   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 view
  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.

Re: FW_OpenAdoConnection problem with 2 connections

PostPosted: Tue Mar 12, 2019 10:02 am
by damianodec
hi Mr. Rao,
In these days I'm out of Office, I'll try it..
thank you very much!