Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows authentication and database role

Status
Not open for further replies.

swetab

Programmer
May 6, 2003
49
0
0
US
Provider=SQLOLEDB;Integrated Security=SSPI;Initial Catalog=test; Data Source=k36;

Hello I have created a exe in vb6.0 using the above connection string, Users can access the application only by windows authentication.

In SQL server 2000 i gave the access to a windows user with db_datareader role and when the user tired to access got this error "Invalid Data source"

I gave the same user db_owner and it works with out error

I do not want to create users with role db_owner in SQL server.
How to make them just db_datareader?

Thanks
 
Just a thought...
Invalid Data Source tells me that your app is not physically connecting to the server, access denied would be more appropriate to what you are describing. Try creating a xxx.udl file on the machine you are running the exe and see if the above connection string properties test out ok.
 
I am sorry, i posted the error message wrongly
Error : "Invalid procedure call or argument."

I tested the .udl file connection was succesful.

 
That sounds like a syntax error on the cn.Open method Can you post what line you are getting this error?
 
Another thought...you may also want to make sure your rs.Open method properties are for a read-only.
 
I am using conObj.CursorLocation = adUseServer,
I think this is causing the problem, just read that "adUserServer property is read/write on a Connection."

And as u said I will use readonly for locktype and try and execute it at the client side.

Thanks

 
Feel free to post your code if you're still having trouble.
 
I found something, when a user is given db_datareader permission, it was erroring out when executing the stored procedures, so from sql server EM I gave the user exec permissions and the application ran succesfully.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top