Module CNT Public Cnx As New ADODB.Connection Public Rs As New ADODB.Recordset Public Sql As String Public NomeUser As String Sub Abrir() Cnx.Open("dsn=ALUGUEL") End Sub Sub Fechar() Cnx.Close() End Sub End Module
Sub Mostra() ListView1.Items.Clear() Call Abrir() Sql = "Select * from V_Aluguel" Rs.Open(Sql, Cnx, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) Dim Li As ListViewItem Li = ListView1.Items.Add(Rs.Fields("Marca").Value) Li.SubItems(1) = Rs.Fields("Modelo").Value Li.SubItems(2) = Rs.Fields("NumAlug").Value Rs.Close() Call Fechar() End Sub
Rs.MoveNext
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)