Beruflich Dokumente
Kultur Dokumente
Visual ABM 2da Parte
Visual ABM 2da Parte
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' LV = ListView ''
'' cnn = Conector ''
'' rs = Recordset ''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' variables para la conexión y el recordset
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public cnn As New ADODB.Connection
Public rs As New ADODB.Recordset
Public ObjItem As ListItem
Dim i As Integer
LV.Arrange = lvwNone
LV.BorderStyle = ccNone
LV.DragMode = vbManual
LV.FlatScrollBar = True
LV.Font = "Verdana"
LV.FullRowSelect = True
LV.GridLines = True
LV.HideSelection = False
LV.LabelEdit = lvwManual
LV.View = lvwReport
With LV
' Agrega dos columnas
.ColumnHeaders.Add , , "ID"
.ColumnHeaders.Add , , "Nombre"
.ColumnHeaders.Add , , "Apellido"
.ColumnHeaders.Add , , "Telefono"
.ColumnHeaders.Add , , "Direccion"
.ColumnHeaders.Add , , "Sexo"
.ColumnHeaders.Add , , "Fecha"
End With
'Abre conexion
With cnn
.CursorLocation = adUseClient
.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\
datos.mdb" & ";Persist Security Info=False"
End With
'Limpia el LV
LV.ListItems.Clear
ObjItem.SubItems(1) = rs!Nombre
ObjItem.SubItems(2) = rs!Apellido
ObjItem.SubItems(3) = rs!Telefono
ObjItem.SubItems(4) = rs!Direccion
If Abs(rs!sexo) = 0 Then
ObjItem.SubItems(5) = "Masculino"
Else
ObjItem.SubItems(5) = "Femenino"
End If
ObjItem.SubItems(6) = rs!FechaDeAlta
End If
Exit Sub
ErrorSub:
MsgBox ("ERROR")
End Sub