hello, Im having problem with accessing Access DB with username and password, I used an sql statement but it doesnt work...do you know the code to enter to A Database with username and password??

this is the code i wrote:

Private Sub Form_Load()
' connecting the DB and the table

strFileName = App.Path & "\mydatabase.mdb"
Set db = OpenDatabase(strFileName)
Set rs_lgn = db.OpenRecordset("login")
pswrd = rs_lgn![password]
usrnme = rs_lgn![UserName]

End Sub

and on the click button i wrote:
sqlstr = "SELECT * FROM rs_lgn WHERE usrnme =" & username_inpt_local & "AND pswrd = " & password_inpt_local

'Set rs_lgn_true = db.OpenRecordset("sqlstr")

and so on.. but it doesnt work..
thank you


Eli