help adodb.recordset

Post Reply
Vladimir Zorrilla
Posts: 225
Joined: Tue Feb 28, 2006 4:25 pm
Location: PERU

help adodb.recordset

Post by Vladimir Zorrilla »

Friends have problem for connection recordset

adoadodb.recordset following error:

Error description: Error adodb.recordset/-1 DISP_E_BADPARAMCOUNT: adodb.recordset:ACTIVECONNECTION
Args:
[ 1] = O Object
[ 2] = C Object
[ 3] = O Object
[ 4] = U Object
[ 5] = U Object
[ 6] = U Object
[ 7] = U Object
[ 8] = U Object
[ 9] = U Object
[ 10] = U Object
[ 11] = U Object

Stack Calls
===========
Called from TOLEAUTO:ACTIVECONNECTION(687)
Called from SQL(53)





FUNCTION SQL( cComando)
LOCAL lOK:=.T.
LOCAL cStringConexionLocal:="Provider=SQLOLEDB;server=localhost;database=aduana;integrated security=sspi"//"Provider=SQLNCLI;Server=localhost;Database=aduana;Uid=sa;Pwd="
TRY
oCon:=toleauto():new("adodb.connection")
CATCH oError
MsgStop( "Lnea 19", "rutinasdeconexion.prg")
lOK:=.F.
END
IF lOk
oCon:ConnectionString:=cStringConexionLocal
TRY
oCon:Open()
CATCH oError
lOK:=.F.
oCon:=NIL
END
IF lOk
//creamos un objeto recordset para ejecutar los queries
TRY
oDatos:=TOleAuto():New("adodb.recordset")
CATCH oError
lOK:=.F.
oCon:Close()
oDatos:=NIL
oCon:=NIL
END
IF lOk

oDatos:CursorLocation := 3 //adUseServer //adUseClient
oDatos:LockType := 3 // adLockOptimistic
oDatos:CursorType := 1 // adOpenKeyset
oDatos:Source:=cComando

/////////////// line 53 error ///////////////////////////

oDatos:ActiveConnection(oCon)



TRY
MsgInfo( "Lnea 112", "rutinasdeconexion.prg")
oDatos:Open()
CATCH oError
MsgStop( "Lnea 115", "rutinasdeconexion.prg")
MsgStop(oError:Operation,"adodb.recordset")
lOK:=.F.
oCon:Close()
oDatos:=NIL
oCon:=NIL
END
ELSE
oCon:Close()
oDatos:=NIL
oCon:=NIL
ENDIF
ELSE
oCon:Close()
oCon:=NIL
ENDIF
ELSE
oCon:=NIL
ENDIF
RETURN lOk


Regards
ME INTERESA FW Y XHB POR SER OPEN SOURCE
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

Please try
oDatos:ActiveConnection := oCon
Regards

G. N. Rao.
Hyderabad, India
Post Reply