Results 1 to 4 of 4
  1. #1
    ERKR is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    2

    How do I use Command switch in SQL pass-through query

    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?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Ucase is a built in function for Access. I am not sure if SQL is going to match case in a where clause anyway. Maybe try removing it.

  3. #3
    ERKR is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    2
    OK..I'll try that..Tahnk you.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Pass through queries require the sql dialect of the database on which they run.
    Access's UCASE is UPPER in Oracle
    see http://psoug.org/definition/UPPER.htm

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 14
    Last Post: 02-19-2013, 03:16 PM
  2. Replies: 8
    Last Post: 02-05-2013, 02:36 PM
  3. Select Query in Switch Function
    By sandlucky in forum Queries
    Replies: 0
    Last Post: 03-30-2011, 04:54 AM
  4. Replies: 3
    Last Post: 10-13-2010, 09:40 AM
  5. Pass command line parameters
    By lanto3000 in forum Access
    Replies: 2
    Last Post: 03-21-2010, 03:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums