Question

Locked

Application roles through VBA

By Dynic-IT ·
Hello

Can someone please help. I am trying to connect to a SQL2005 database through VBA in Excel. I have set up a Application Role with permission to select from my database, and it works fine from my computer, but it doesn't work on a regular users computer.

I'm a full administrator, and the users computer gives a "Type mismatch" error when I try and open the connection, which makes me think that the logon is using Windows authentication and ignoring the Application Role

Connection String:
"Provider=SQLOLEDB;server=<SERVER>;Initial Catalog=<DATABASE>;Integrated Security=SSPI;UID=<Application Role>;Pwd=<Passwprd>;"

Code:
Dim rs As ADODB.Recordset
Dim objConnection As New ADODB.Connection
objConnection.Open <CONNECTION STRING>
Set rs= objConnection.Execute("<SELECT STATEMENT>")

Thanks

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums