Pregunta de ADO
Posted: Fri Mar 22, 2013 9:10 pm
Tenga una inquietud , tengo diseñado un formulario , cuando navego avanzo a otro registro solamente me llega hasta el record 15 y parece que este fuera el final del archivo , pero en realidad la base de datos tiene mas de 1000
Hay algun parametro en ADO que me esta bloqueando los demas registros,
Asi Hago la Conexion
y para tipo record asi.
Hay algun parametro en ADO que me esta bloqueando los demas registros,
Asi Hago la Conexion
Code: Select all
Function Conectar()
Local Retorno:=.F.
LOCAL rs, oErr,oCs
local odbcli
Local cSelect
//Public oCn
TRY
oApp:oServer:= CreateObject( "ADODB.Connection" )
oApp:oServer:Open(oApp:oConexion)
oApp:oADOoSql:=TOleAuto():New("ADODB.Command")
oApp:oADOoSql:CommandType := adCmdText
oApp:oADOoSql:ActiveConnection:= oApp:oServer
Retorno:=.T.
CATCH oErr
MSGAlert("Error : No se tiene acceso al servidor " + CRLF +;
"por favor verifique conexion a red o que el servidor este funcionando", ;
"Error: " + oErr:Operation + " -> " + oErr:Description )
Retorno:=.F.
END
Return Retorno
Code: Select all
local oErrorAdo
local oErrorCmd
Local nTime1:=seconds()
Local oRcs
DEFAULT cSelect := ("select * from " + ALLTRIM(cTable))
DEFAULT LockType :=adLockOptimistic
DEFAULT CursorLocation :=adUseClient
DEFAULT CursorType :=adOpenDynamic
DEFAULT lPaged :=.F.
cTable := Lower(cTable) // Lo coloco Ruben UPPER mayuscula Lower --> Minuscula
::lBuffer :=.T.
::lOemAnsi :=.F.
::cSelect :=Lower(cSelect)
::cTable :=cTable
::oCon :=oConnect
::LockType :=LockType
::CursorLocation :=CursorLocation
::CursorType :=CursorType
::lPaged :=lPaged
If !IfTable(cTable,oConnect)
MsgAlert("Error : " + Alltrim( cTable ) + " No Existe !!!","Verifique Nombre de Tabla" )
::lExists:=.F.
Return Self
Endif
::TableRecCount()
If ::lPaged=.T.
::Inicia()
Else
oRcs:=TOleAuto():New("ADODB.recordset")
oRcs:CursorLocation:= CursorLocation
oRcs:CacheSize := ::nPageSize
oRcs:PageSize := ::nPageSize
TRY
oRcs:Open(cSelect,oConnect,CursorType,LockType) //1,3 )
CATCH oErrorAdo
ShowError(oErrorAdo,"New ADOBASE")
END
::oRcs := oRcs
Endif
::tElapsed:= (Seconds() -nTime1)
If ::oRcs:CursorLocation = 3 // adUseClient
::oRcs:Properties("Unique Table"):Value := cTable
Endif
//Try
::nFields:=::oRcs:Fields:Count
//Catch oErrorAdo
// ShowError(oErrorAdo,"Field Count")
//End
::aBuffer:=Array( ::nFields )
::Struct()
::Load()
::aFldNames := {}
For n = 1 To ( ::nFields )
AAdd( ::aFldNames, upper( ::FieldName( n-1 )) ) //AAdd( ::aFldNames, ::FieldName( n-1 ) ) // Ruben
Next