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("t he patht of database")
MsgBox "database is open"
Set rec = db.OpenRecordse t("SELECT DISTINCT asmenu_info.Var das 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
Dim db As Database
Dim rec As Recordset
Private Sub Command1_Click( )
Set db = OpenDatabase("t he patht of database")
MsgBox "database is open"
Set rec = db.OpenRecordse t("SELECT DISTINCT asmenu_info.Var das 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
Comment