Dim I, cont As Integer
Dim lngFilas As Long = dvgconsulta.Rows.Count - 1
Try
con.Execute("DELETE FROM SISBEN")
With dvgconsulta
Cerrar(rsDatos)
rsDatos.Open("SELECT COUNT(*) FROM SISBEN", con, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
For I = 0 To lngFilas
con.Execute("INSERT INTO SISBEN(FICHA,ZONA,BARRIO,DIRECCION,FECENCUESTA,APE1,APE2,NOM1,NOM2,TIPODOC,DOCUMENTO,FECHNAC,SEXO,PUNTAJE,FECACTENCUESTA,NIVSISBEN,EDAD) VALUES ('" & .Item("FICHA", I).Value & "','" & .Item("ZONA", I).Value & "','" & .Item("BARRIO", I).Value & "','" & .Item("DIRECCION", I).Value & "','" & FechaAMD(.Item("FECENCUESTA", I).Value) & "','" & .Item("APE1", I).Value & "','" & .Item("APE2", I).Value & "','" & .Item("NOM1", I).Value & "','" & .Item("NOM2", I).Value & "','" & .Item("TIPODOC", I).Value & "','" & .Item("DOCUMENTO", I).Value & "','" & FechaDMA(.Item("FECHNAC", I).Value) & "','" & .Item("SEXO", I).Value & "','" & .Item("PUNTAJE", I).Value & "','" & FechaAMD(.Item("FECACTENCUESTA", I).Value) & "','" & .Item("NIVSISBEN", I).Value & "','" & .Item("EDAD", I).Value & "')")
cont += 1
Contar.Text = cont
Next
MsgBox("Usuarios cargado con exito")
End With
Catch ex As Exception
sbError.Text = ex.Message
End Try