Tech Off Thread

1 post

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Access - Changing the Current Session Workgroup File?

Back to Forum: Tech Off
  • User profile image

    Documentation states the currently open database session mdw cannot be reassigned because DBEngine.SystemDB is read only.

    You can however reassign the mdw for another database which seems at odds with this. Is the latter really impossible?

    Paraphrasing some code:

    MyOldMDW = DBEngine.SystemDB
    DBEngine.SystemDB = c:\myfolder\mynew.mdw
    wsp = DBEngine.CreateWorkspace("x", "U1","Psw")
    dbs = wsp.OpenDatabase(CurrentDB.Name, false,false)
    . Do something
    DBEngine.SystemDB = MyOldMDW

    The 'wsp =' line, errors, as user not found. This is because U1 is not a user in the old mdw but is a user in the new one and the mdw never got reassigned.

    The line DBEngine.SystemDB = c:\myfolder\mynew.mdw does not error because Access has no way of knowing what you are going to do next.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.