I've got a VBA macro that connects to the Accpac MSSQL database (v5.3). I'm using a UDL file that contains the connection information. The UDL file is logging on to the database using the sa account and it used by other processed without an issue.
I'm getting permissions errors and see that the stored procedure simply isn't running when I sign on to the network as a user. When I log on as an administrator account the code runs as planned.
This code checks for the existance of the stored procedure:
When the user account runs this the query returns 0. Then it attempts to add the stored procedure and I get the following error: CREATE PROCEDURE permission denied in database 'ABCDAT'.
I'm using the connection object to run the script directly (sSql being the script text):
When the user account runs nothing happens. When the administrator account runs then the stored procedure runs.
I've tried hardcoing the connection string in case the UDL file contents were being misinterpreted but no dice.
Any ideas?
I'm getting permissions errors and see that the stored procedure simply isn't running when I sign on to the network as a user. When I log on as an administrator account the code runs as planned.
This code checks for the existance of the stored procedure:
Code:
Dim lQry As New ADODB.Recordset
lQry.Open "SELECT count(*) FROM sysobjects WHERE [name] = 'OEItemSalesHistory'", cn
If lQry.Fields(0).Value = 1 Then GoTo ExecuteIt
When the user account runs this the query returns 0. Then it attempts to add the stored procedure and I get the following error: CREATE PROCEDURE permission denied in database 'ABCDAT'.
I'm using the connection object to run the script directly (sSql being the script text):
Code:
cn.Execute sSql
When the user account runs nothing happens. When the administrator account runs then the stored procedure runs.
I've tried hardcoing the connection string in case the UDL file contents were being misinterpreted but no dice.
Any ideas?