error en tipo de dato al insertar en un listview
Publicado por DANIEL (9 intervenciones) el 17/01/2018 20:05:06
Buenas compañeros estoy trancado en algo no encuentor porque el error, estoy tratando de ingresar los datos de una tabla en sql, perdon una vista con solo un campo y mostrar en un listview, pero al ingresar el dato me envia un error 13: en tiempo de ejecucion, no conciden los tipos de datos aqui les dejo el codigo haber que esta pasando si alquien sabe como corregir el error:
La seccion de las columna del listview
AYUDA............
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Private Sub Command1_Click()
Dim ENE, FEB, MAR, ABR, MAY, JUN, JUL, AGO, SEP, OCT, NOV, DIC, TOTAL As Integer
Dim DEP As String
Dim item As ListItem
Dim ReporteRs As ADODB.RecordsetDim SUMA As Long
SUMA = 0COLUMNAS
Me.lstListado.ListItems.Clear
Me.lblInfo.Caption = "0 registros."
Set ReporteRs = New ADODB.Recordset
With ReporteRs
.Open "Select departamento From Vs_Prueba", CONEXION_ADO, adOpenStatic, adLockOptimistic
If .RecordCount <> 0 Then
.MoveFirstMe.PB2.Max = .RecordCount
Me.PB2.Min = 0
Me.PB2.Value = 0
Do While Not .EOFMe.PB2.Value = Me.PB2.Value + 1
If IsNull(.Fields("departamento")) Or .Fields("departamento") = "" Then
DEP = ""
Else
DEP = Mid(.Fields("departamento"), 1, 50)
End If
Set item = Me.lstListado.ListItems.Add(, , DEP)
SUMA = SUMA + 1
.MoveNextLoop
Me.PB2.Value = 0
End If
.CloseEnd With
Set ReporteRs = NothingEnd Sub
La seccion de las columna del listview
1
2
3
4
5
6
7
8
9
10
11
12
Private Sub COLUMNAS()
Me.lstListado.ColumnHeaders.Clear
'//----------------------------Formato de las columnas-------------------------------
Me.lstListado.ColumnHeaders.Add , , "DEPARTAMENTO", 5000
Me.lstListado.View = lvwReport
Me.lstListado.LabelEdit = lvwManual
Me.lstListado.FullRowSelect = True
End Sub
AYUDA............
Valora esta pregunta


0

