I open the first connection (DB2):
pgm1.prg
- Code: Select all Expand view
Connessione := "Provider=IBMDA400; Data Source=192.168.1.1; User Id=userid; Password=password; Default Collection=Library;"
oCn := FW_OpenAdoConnection( Connessione, .t.)
DB2 connection remains open for the duration of the program.
I open the second connection (SQl Server):
pgm2.prg
- Code: Select all Expand view
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
then reopen the pgm2.prg (SQL SERVER) and to istruction
- Code: Select all Expand view
oDbo := FW_OpenRecordSet( oCnSrv, tuple, 1 )
I Get that error: IBMDA400 is it's already open (the first connection).
in adofuncs.pgm if I comment out the lines 91-94 and 100-103 the pgm works without errors
- Code: Select all Expand view
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
Why ?