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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CurrentUser = Enter Parameters ???

Status
Not open for further replies.

neillovell

Programmer
Aug 27, 2002
560
GB
As you may have read, I have converted a form in to a data access page (.htm). The form is based on a query that retrieves records from a table based on the value of CurrentUser(). Ergo, the user only has access to records that are relevant to them.

My SQL uses a WHERE clause to retrieve the records,

WHERE (((ADMINRecordsTable.LogOnName)=CurrentUser()));

This however has led to errors when accessing the records from outside access. I put the .htm file (along with the database itself and updated the connection strings) onto the network and double clicked it, entered my password, but unfortunately it tells me

'Data provider failed when performing provider command'
followed by
'CurrentUser() undefined'

I tested a bit and found that
WHERE (((ADMINRecordsTable.LogOnName)=neil-lovell));

works perfectly, all records matching neil-lovell are retrieved and the user can change, add, and save no problem. However, this is not much good if you are not Neil Lovell!!!

I have found that
WHERE (((ADMINRecordsTable.LogOnName)=CurrentUser));

(note the lack of () ) brings up a dialog box asking for the parameters for LogOnName and CurrentUser. If I specify neil-lovell for both of these I get access to the entire set of records.

Has anyone come across this before?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top