I'm rather green in the use of VB6 but it seems to be rather fun to make my own .exe files instead of just making MSAccess databases.
Now to my question:
In MSAccess I offen use HLookup and for what I can tell I can't use it in VB6
But I saw in this forum that i can use OpenRecordset to simulate HLookup an get the same result.
When I run this code I get a stange message:
Syntax error(missing operator) in query expression 'strUserName= John Smith'.
My code looks like this:
Expand|Select|Wrap|Line Numbers
- Dim db As DAO.Database
- Dim rs As DAO.Recordset
- Set db = DAO.DBEngine(0).OpenDatabase("C:\Users\Marcus\Marcus jobb\Rekvisitioner vb6\Rekvisitioner-97.mdb")
- Set rs = db.OpenRecordset( _
- "Select [strPassword] From tblUsers Where strUserName = txtUser")
Thank you for your help