CREATE A USER in MS Access 2010

I searched for a few hours on how to create a user using SQL for the database that I am creating in Access. I found several sources on the Microsoft website that say I can use the command CREATE USERfor this. However, whenever I try to run a query, an error message appears Syntax error in CREATE TABLE statement. What am I doing wrong? Thanks in advance for your help! If you're curious, the code format, which I'm trying to use, as follows: CREATE USER username, password, pid.

+4
source share
1 answer

Access supports CREATE USER as a DDL statement, but unfortunately it will not work in all contexts. In particular, this will not work if we try to run it from

  • The query constructor is in access itself
  • connecting the DAO to the database or
  • ODBC connection to the database.

It will only work when launched from an OLEDB connection to the database. This can be done from VBA code in the Access database itself using an object CurrentProject.Connection, for example:

CurrentProject.Connection.Execute _
        "CREATE USER newuser newpassword newpid"

(Note that there are no commas between the three arguments in the CREATE USER statement.)

+2
source

All Articles