Hello All,
The code below is producing errors, specifically at the line
Set db= DBEngine.OpenDatabase(dbName)
I keep getting the following error: "You donot have necessary permissions to access \\xsystems\systems\series\yha\...Please contact security adminsistrator to get proper permissions"
I do have the required permissions and I am able to access the path above and open the database, when I click on the db.
Here is the code:
I should mention that the shell command runs with no problems, so I do have proper permissions but not sure why i am getting this error.
Thanks
AV
The code below is producing errors, specifically at the line
Set db= DBEngine.OpenDatabase(dbName)
I keep getting the following error: "You donot have necessary permissions to access \\xsystems\systems\series\yha\...Please contact security adminsistrator to get proper permissions"
I do have the required permissions and I am able to access the path above and open the database, when I click on the db.
Here is the code:
Code:
[COLOR=navy]
Sub OpenDB(dbName As String,FileMDW as string,psd as String)
Dim wks As DAO.Workspace
Dim db As DAO.Database
Dim dbApp As Access.Application
'This finds the dir of ms access.
strCmd = SysCmd(acSysCmdAccessDir) & "\MSAccess.exe " _
& dbName & " /wrkgrp " & FileMDW _
& " /user test1 /pwd " & psd
Call Shell(strCmd, vbNormalFocus)
MsgBox "just ran shell"
Set wks = DBEngine.Workspaces(0)
MsgBox "workspace created"
wks.BeginTrans
MsgBox "trans began and about to open db"
'line below is where error occurs
Set db = DBEngine.OpenDatabase(dbName)
MsgBox "db opened successfully"
[/color navy]
I should mention that the shell command runs with no problems, so I do have proper permissions but not sure why i am getting this error.
Thanks
AV