Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CurrentDB object invalid in ADP, how to replace it ? 2

Status
Not open for further replies.

GarHeard

Programmer
May 3, 2005
28
US
The following statement works fine when I use it in an MDB file. However, I converted my Access Application to an ADP and now I get the following error message:

Run time error '91':
Object variable or With block variable not set

The offending line is as follows:

CurrentDb.Execute "UPDATE tblSecurity SET PASSWORD=" & Chr(34) & Me!txtPasswordNew & Chr(34) & " WHERE USERID= " & Me!cboEmpNew.Value

Since CurrentDb is not a valid object in ADP, do you know
how I could replace this statement ?
 
Use the ADO connection:

[tt]currentproject.connection.execute "Update...."[/tt]

CurrentDB creates an instance of a DAO Database, and ADP only uses ADO.

Roy-Vidar
 
And use single quotes for literal values:
CurrentProject.Connection.Execute "UPDATE tblSecurity SET PASSWORD='" & Me!txtPasswordNew & "' WHERE USERID=" & Me!cboEmpNew.Value

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top