codice:
Sub fLoadRecordSet()
Dim strQuery As String, strstring As String
Static ConnAccess As New ADODB.Connection
Dim rsServer As New ADODB.Recordset
If ConnAccess.State = 0 Then
ConnAccess.Open strConnAccess
End If
strstring = "SELECT * FROM associazioni order by Denominazione asc"
Set rsServer = ConnAccess.Execute(strstring)
On Error Resume Next
Do While Not rsServer.EOF
Set xItem = LstView.ListItems.Add(Text:=Trim(rsServer("IdAssociazioni")))
xItem.ListSubItems.Add , , Text:=rsServer("nome")
xItem.ListSubItems.Add , , Text:=rsServer("cognome")
xItem.ListSubItems.Add , , Text:=rsServer("Telefono")
xItem.ListSubItems.Add , , Text:=rsServer("cellulare")
xItem.ForeColor = QBColor(2)
xItem.Checked = False
rsServer.MoveNext
Loop
rsServer.Close
End Sub