General information
Category:
Object Oriented Programming
The code is the same from the example,
Project CapaDatos, with .prg capadatos
DEFINE CLASS Capadatos as Session OlePublic
protected miConecion
miConecion =""
procedure conectar
cConnString="DRIVER={MySQL ODBC 3.51 Driver};Server=localhost;option=131609;Database=jbinf;UID=root;PASSWORD=root;"
oConnection = createobject("adodb.connection")
oConnection.ConnectionString=cConnString
oConnection.open()
this.miConecion=oConnection
EndProc
Procedure CargaLista() as ADODB.RecordSet
oRecordSet = createobject("ADODB.Recordset")
oRecordset.ActiveConnection = This.miConecion
*oRecordSet.CursorType = adOpenStatic
oRecordSet.LockType = adLockOptimistic
oRecordSet.CursorLocation = adUseClient
oRecordSet.CursorType = adOpenKeySet
oRecordSet.Open ("select * from cliente", this.miConecion)
return oRecordset
EndProc
EndDefine
Project CapaNegocios, with .prg capanegocios
DEFINE CLASS CapaNegocios as Session OlePublic
Procedure ListaClientes() as ADODB.RecordSet
oCapaDatos = CREATEOBJECT('capadatos.capadatos')
oCapadatos.Conectar()
miListaClientes = oCapadatos.cargaLista()
return miListaClientes
EndProc
* Procedure ConsultaEstadoCuenta( miCliente as string ) as ADODB.RecordSet
* EndProc
EndDefine
MyProject
Call the object
ocapanegocios=createobject("capanegocios.capanegocios") ---> Error Here ???
miRecordset=oCapaNegocios.ListaClientes()
thisform.processa(miRecordSet)
thisform.Refresh
João Batista
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only