A continuaci�n se describen y codifican las propiedades que utiliza la clase MGDatos.
�BookMark
Descripci�n: Marca un registro para una futura localizaci�n o devuelve una marca de registro.
C�digo:
' *********************************************
' PROPIEDAD : BookMark
' Propiedad BOOKMARK del recordset.
' *********************************************
Public Property Let BookMarck(ByVal vData As Variant)
If HaySeleccionAbierta Then
On Error GoTo ErrorBookMark
Datos.Bookmark = vData
On Error GoTo 0
Else ' No hay una selecci�n abierta.
RaiseEvent MGError(120, "No hay una selecci�n abierta.")
End If
SalirBookMark:
Exit Property
ErrorBookMark:
RaiseEvent MGError(410, "Error al intentar devolver un registro marcado. "
+ vbCrLf + Str$(Err.Number) + " - " + Err.Description)
Resume SalirBookMark
End Property
Public Property Get BookMarck() As Variant
If HaySeleccionAbierta Then
On Error GoTo ErrorBookMark
BookMarck = Datos.Bookmark
On Error GoTo 0
Else ' No hay una selecci�n abierta.
RaiseEvent MGError(120, "No hay una selecci�n abierta.")
End If
SalirBookMark:
Exit Property
ErrorBookMark:
RaiseEvent MGError(400, "Error al intentar marcar el registro. "
+ vbCrLf + Str$(Err.Number) + " - " + Err.Description)
Resume SalirBookMark
End Property
�CadenaConexion
Descripci�n: Devuelve la cadena de par�metros utilizada para abrir la conexi�n.
C�digo:
' *********************************************
' PROPIEDAD : CadenaConexion
' Devuelve la cadena de conexi�n activa.
' *********************************************
Public Property Get CadenaConexion() As String
CadenaConexion = mvarCadenaConexion
End Property
�CamposCount
Descripci�n: Devuelve el n�mero de campos de la selecci�n abierta.
C�digo:
' *********************************************
' PROPIEDAD : CamposCount
' Numero de campos de la selecci�n.
' *********************************************
Public Property Get CamposCount() As Integer
If HaySeleccionAbierta Then
CamposCount = Datos.Fields.Count
Else
RaiseEvent MGError(120, "No hay una selecci�n abierta.")
End If
End Property
�DBDirMDB y DBNombreDBDSN
Descripci�n: Devuelve o establece el directorio de acceso a la base de datos, (DBDirMDB), y el nombre de la base de datos o la configuraci�n, (DSN), ODBC, (DBNombreDBDSN).
C�digo:
' *********************************************
' PROPIEDAD : DBDirMDB
' Directorio de la base de datos Access, (mdb)
' *********************************************
Public Property Let DBDirMDB(ByVal vData As String)
If HayConexionAbierta Then
RaiseEvent MGError(100, "Hay una conexi�n abierta.
No puede manipular las propiedades de origen de los datos.")
Else
mvarDirMDB = vData
End If
End Property
Public Property Get DBDirMDB() As String
DBDirMDB = mvarDirMDB
End Property
' *********************************************
' PROPIEDAD : DBNombreDBDSN
' Nombre de la base de datos.
' *********************************************
Public Property Let DBNombreDBDSN(ByVal vData As String)
If HayConexionAbierta Then
RaiseEvent MGError(100, "Hay una conexi�n abierta.
No puede manipular las propiedades de origen de los datos.")
Else
mvarNombreDBDSN = vData
End If
End Property
Public Property Get DBNombreDBDSN() As String
DBNombreDBDSN = mvarNombreDBDSN
End Property
�DBPassWord y DBUser
Descripci�n: Devuelve o establece el nombre de usuario, (DBUser), y la contrase�a, (DBPassWord), de acceso a la base de datos.
C�digo:
' *********************************************
' PROPIEDAD : DBUser
' Usuario, (login) de la base de datos.
' *********************************************
Public Property Let DBUser(ByVal vData As String)
mvarDBUser = vData
End Property
Public Property Get DBUser() As String
DBUser = mvarDBUser
End Property
' *********************************************
' PROPIEDAD : DBPassword
' Password de la base de datos.
' *********************************************
Public Property Let DBPassword(ByVal vData As String)
mvarDBPassword = vData
End Property
Public Property Get DBPassword() As String
DBPassword = mvarDBPassword
End Property
�EsBOF y EsEOF
Descripci�n: Devuelve si el cursor ha llegado al final de la base de datos, (EsEOF), o al principio de la misma, (EsBOF).
C�digo:
' *********************************************
' PROPIEDAD : EsEOF
' �Est� el cursor al final de la selecci�n?
' *********************************************
Public Property Get EsEOF() As Boolean
If HaySeleccionAbierta Then
EsEOF = Datos.EOF
Else
RaiseEvent MGError(120, "No hay una selecci�n abierta.")
End If
End Property
' *********************************************
' PROPIEDAD : EsBOF
' �Est� el cursor al principio de la selecci�n?
' *********************************************
Public Property Get EsBOF() As Boolean
If HaySeleccionAbierta Then
EsBOF = Datos.BOF
Else
RaiseEvent MGError(120, "No hay una selecci�n abierta.")
End If
End Property
�HayConexionAbierta
Descripci�n: Devuelve si hay una conexi�n abierta, (funci�n : AbrirConexion).
C�digo:
' *********************************************
' PROPIEDAD : HayConexionAbierta
' �Hay una conexi�n abierta?
' *********************************************
Private Property Let HayConexionAbierta(ByVal vData As Boolean)
mvarHayConexionAbierta = vData
End Property
Public Property Get HayConexionAbierta() As Boolean
HayConexionAbierta = mvarHayConexionAbierta
End Property
�HaySeleccionAbierta
Descripci�n: Devuelve si hay una selecci�n abierta, (funci�n : AbrirSeleccion).
C�digo:
' *********************************************
' PROPIEDAD : HaySeleccionAbierta
' �Hay una selecci�n abierta?
' *********************************************
Private Property Let HaySeleccionAbierta(ByVal vData As Boolean)
mvarHaySeleccionAbierta = vData
End Property
Public Property Get HaySeleccionAbierta() As Boolean
HaySeleccionAbierta = mvarHaySeleccionAbierta
End Property
�InfoCampo
Descripci�n: Devuelve un objeto ADODB.Field con la informaci�n de un campo v�lido con la selecci�n abierta.
C�digo:
' *********************************************
' PROPIEDAD : InfoCampo
' Devuelve la colecci�n FIELD del campo solicitado.
' *********************************************
' Par�metros :
' Index : Indice o literal del campo a devolver.
' *********************************************
Public Property Get InfoCampo(Index) As ADODB.Field
If HaySeleccionAbierta Then
Set InfoCampo = Datos.Fields(Index)
Else
RaiseEvent MGError(120, "No hay una selecci�n abierta.")
End If
End Property
�NumRegistrosSel
Descripci�n: Devuelve el n�mero de registros, (filas), de la selecci�n abierta.
C�digo:
' *********************************************
' PROPIEDAD : NumRegistrosSel
' Devuelve el n�mero de registros de la selecci�n.
' *********************************************
Public Property Get NumRegistrosSel() As Long
If HaySeleccionAbierta Then
NumRegistrosSel = Datos.RecordCount
Else
RaiseEvent MGError(120, "No hay una selecci�n abierta.")
End If
End Property