Hello I want to show the results of MS Access database query in Visual basic. Do you know how to do this? I want to show the results in objects such as label or text box. Please help me. My code is:
Dim db As Database
Dim rec As Recordset
Private Sub Command1_Click()
Set db = OpenDatabase("the patht of database")
MsgBox "database is open"
Set rec = db.OpenRecordset("SELECT DISTINCT asmenu_info.Vardas FROM asmenu_info;")
While Not rec.EOF
Label1.Print rec!vardas
rec.MoveNext
Wend
rec.Close
db.Close
End Sub
If i do this with second form everythig is ok, but I want to do this with label or text box