Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Access Projects and Application Roles

Author  Topic 

djmack
Starting Member

8 Posts

Posted - 2004-03-03 : 16:01:59
Posted - 03/03/2004 : 14:49:31
--------------------------------------------------------------------------------

Hello All,
I am trying to invoke an application role via an MS Access project. I created a function and put it into a Autoexec macro:
Public Function StartUp()
Dim provStr As String


'Specify connection string on OPen Method.
provStr = "Provider=sqloledb;Data Source=Cdalene4;Initial Catalog=CWETest;Integrated Security=SSPI"
MyDB.Open provStr
TSQL = "EXEC sp_setapprole 'username','pswrd'"
Application.CurrentProject.Connection.Execute TSQL
DoCmd.OpenForm "frmUserQuery"
Exit Function
End Function

The macro does what it is suppose to but when I try to select things from views in the form that pops-up I get "select permission denied on view".

Does it seem like this is something on the client side application or something on the server side?

Any ideas/suggestions would be greatly appreciated.

DM

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-03-03 : 17:07:49
don't know if this has any bearing on things, but you why are you opening a new connection (myDB) and then execting your TSQL against a different, already open connection?

of course, you might just be leaving out some code ...

- Jeff
Go to Top of Page

djmack
Starting Member

8 Posts

Posted - 2004-03-03 : 17:26:51
No you were right and that was the problem works fine now.

Thanks you very much for your help,
DM
Go to Top of Page
   

- Advertisement -