Im trying to create an SQL pass-through query in Access which include a command switch that collect username that is sent to the database through a bat-file when starting the database.
Bat-file looks like this: START MSACCESS "X:\Access\Users.accdb" /CMD %USERNAME%
The query looks like this:
SELECT REPORTOBJECT.OBJECTID, REPORTOBJECT.TABLEID,REPORTOBJECT.REPORTTYPE, REPORTOBJECT.USERNAME, REPORTOBJECT.REPORTNAME, REPORTOBJECT.REPORTDESCR
FROM REPORTOBJECT
WHERE (((REPORTOBJECT.USERNAME)=UCase(Command())));
When I run this I get a message saying ORA-0094: "UCASE": Invalid identifier
When I use UCase(Command() in a regular Access query it works fine but in the SQL pass through it fails.
Anybody who know how to use UCase(Command() in a SQL pass through query?