Visual Basic.NET - NO SE COMO!!!!

 
Vista:

NO SE COMO!!!!

Publicado por Albrieu (4 intervenciones) el 17/01/2005 22:37:58
El siguiente condigo lo utilizo en VB6 y no pude pasarlo a VB.NT alguien sabe como se hace puedo pasarlo mas o menos parecido????

desde ya muchas gracias!!!!

Set vCon = New ADODB.Connection
vCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\mibase.mdb;Persist Security Info=False"
vCon.Open

Set vreg = New ADODB.Recordset
vreg.CursorType = adOpenDynamic
vreg.LockType = adLockOptimistic
vreg.ActiveConnection = vCon

cantColumnas = 10
cantfilas = 0

vreg.Open "select count(*) as Total from Clientes"

If (Not vreg.eof) Or (Not vreg.eof) Then
cantfilas = vreg![Total]
Else
cantfilas = 0
End If
vreg.Close

Call InicializarTbase

vreg.Open "SELECT Clientes.*, Localidades.*, Provincias.* FROM (Clientes LEFT JOIN Localidades ON Clientes.XLocalidad = Localidades.LCodigo) LEFT JOIN Provincias ON Localidades.LProvincia = Provincias.PCodigo order by XCodigo"

Clientes.lstvDatos.ListItems.Clear
Clientes.lstvDatos.Enabled = False

With vreg
If cantfilas > 0 Then
Clientes.lstvDatos.Enabled = True
.MoveFirst
Do While Not .eof
Set Items = Clientes.lstvDatos.ListItems.Add(, , .Fields(0) & "")
Items.SubItems(1) = .Fields(1) & ""
Items.SubItems(2) = .Fields(2) & ""
Items.SubItems(3) = .Fields(3) & ""

If IsNull(vreg![LDescripcion]) Then
Localidad = "???????????"
Else
Localidad = vreg![LDescripcion]
End If
Items.SubItems(4) = Localidad & ""

If IsNull(vreg![LCP]) Then
CPostal = "???????????"
Else
CPostal = vreg![LCP]
End If
Items.SubItems(5) = CPostal & ""

If IsNull(vreg![PDescripcion]) Then
Provincia = "???????????"
Else
Provincia = vreg![PDescripcion]
End If
Items.SubItems(6) = Provincia & ""

Items.SubItems(7) = .Fields(5) & ""
Items.SubItems(8) = .Fields(6) & ""
Items.SubItems(9) = .Fields(8) & ""

.MoveNext
Loop
End If
End With

vreg.Close

vcon.close
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder