
Dim strConn As String
Dim cn As ADODB.Connection
Dim strSQL As String
Set cn = New ADODB.Connection
Dim rs As ADODB.Recordset
Dim i As Integer
strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:DB.accdb;"
cn.ConnectionString = strConn
cn.Open
strSQL = "select A,B,C from TABELLA where C = 2"
Set rs = cn.Execute(strSQL)
If IsNull(rs(0).Value) Then
irismsg = MsgBox("Nessun dato trovato per",vbCancel)
Exit Function
End If
|
strSQL = "select A,B,C from TABELLA where C = 2"
Set rs = cn.Execute(strSQL)
If rs.EOF and rs.BOF Then
irismsg = MsgBox("Nessun dato trovato per",vbCancel)
Exit Function
End If
While not rs.EOF and not rs.BOF
msgbox "Il valore del campo A è: " & rs!A & vbcrlf & _
"Il valore del campo B è: " & rs!B & vbcrlf & _
"Il valore del campo C è: " & rs!C
rs.movenext
Wend |
