Hi,
Can I to have two adodb connections at the same time on different databases?
I have two servers and I'd like to open one connection tu DB2 and another to SQL Server.
thank you
Damiano.
Connessione := "Provider=IBMDA400; Data Source=192.168.1.1; User Id=userid; Password=password; Default Collection=Library;"
oCn := FW_OpenAdoConnection( Connessione, .t.)
cConnSrv := "Provider=SQLOLEDB;server=192.168.1.2\SQLSERVER;database=MYDB;uid=sa;pwd=sa"
oCnSrv := FW_OpenAdoConnection( cConnSrv, .t.)
...
...
tuple := "SELECT A, B FROM SQLTABLE "
oDbo := FW_OpenRecordSet( oCnSrv, tuple, 1 )
xbrowse(oDbo)
oDbo:Close()
oCnSrv:Close()
Return NIL
oDbo := FW_OpenRecordSet( oCnSrv, tuple, 1 )
91 if If( Empty( cSpec ), cConnStr == scStr1 .or. cConnStr == scStr2, cSpec == scSpec )
92 soCn_Check()
93 return soCn
94 endif
95
96 if ! Empty( cSpec )
97 cConnStr := FW_AdoConnectionString( cConnStr, @nDB )
98 endif
99
100 if ( ! Empty( cSpec ) .and. cSpec == scSpec ) .or. cConnStr == scStr1 .or. cConnStr == scStr2
101 soCn_Check()
102 return soCn
103 endif
FW_ReOpenRecordSet(oDbo,oCnSrv, tuple, 1 )
IF oDbo <> NIL
IF oDbo:State() = adStateOpen
oDbo:Close()
ENDIF
ENDIF
oDbo := FW_OpenRecordSet( oCnSrv, tuple, 1 )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 86 guests