Update a field in a different database

G

Guest

I am trying to update a field in a different database from the database I am currently in. The code I currently have is as follows

Dim dbs As Databas
Dim rtbl As Recordse
Dim wsp As Workspac

Set wsp = Workspaces(0
Set dbs = wsp.OpenDatabase(rvarDbs
Set rtbl = dbs.OpenRecordset("zhtblUser", dbOpenTable
rtbl.Index = "PrimaryKey
rtbl.Seek "=", rvarUser ' Find the use
If rtbl.NoMatch Then ' User not foun
std_UserValidate = 1 ' Flag as invalid use
GoTo ExitHer
End I
If rtbl!UserPassword = rvarPW Then ' Password is vali
std_UserValidate = -1 ' Flag succes
rtbl.Edi
rtbl.UserPassword = rNewPassword ****This is the offending lin
rtbl.Updat
rtbl.Clos
Els
std_UserValidate = 2 ' Flag as invalid passwor
End I

The error I get is method or datamember is not found. Any help would be appreciated. I am working in Access 97.
 
M

Marshall Barton

SHIPP said:
I am trying to update a field in a different database from the database I am currently in. The code I currently have is as follows:

Dim dbs As Database
Dim rtbl As Recordset
Dim wsp As Workspace

Set wsp = Workspaces(0)
Set dbs = wsp.OpenDatabase(rvarDbs)
Set rtbl = dbs.OpenRecordset("zhtblUser", dbOpenTable)
rtbl.Index = "PrimaryKey"
rtbl.Seek "=", rvarUser ' Find the user
If rtbl.NoMatch Then ' User not found
std_UserValidate = 1 ' Flag as invalid user
GoTo ExitHere
End If
If rtbl!UserPassword = rvarPW Then ' Password is valid
std_UserValidate = -1 ' Flag success
rtbl.Edit
rtbl.UserPassword = rNewPassword ****This is the offending line


Fields in a recordset are referred to with a ! not a .

rtbl!UserPassword = rNewPassword
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top