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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting permissions on ADP project

Status
Not open for further replies.

belovedcej

Programmer
Nov 16, 2005
358
US
I have an adp project that currently uses bound forms(though that will change in the next phase.)

Our other programmers here use VB.NET and don't know how to help me. I'm also new to SQL Server.

One of the programmers set up a role in SQL to give the correct permissions for my database. He said that I need to set up a connection in VBA that will access that role so that when a user signs on with their windows NT password, the database will also know they can access the database.

We want to set permissions this way instead of letting them just read and write to the tables because we wouldn't want them to access those tables except through the forms I designed.

Here is the VBA I used. I put it on a form that opens as soon as the DB opens, but then that form closes to allow the main screen to open. I have no form that stays open all the time.

It didn't work. My user was unable to access the information. Can anyone help me?

Code:
Set cn = CreateObject("ADODB.Connection")

cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;" & _
                          "Persist Security Info=False;" & _
                          "Initial Catalog=SCO_DB;" & _
                          "Data Source=INTREPID"

cn.Execute "EXEC sp_setapprole 'Mediation_app', {Encrypt N 'mediation'}, 'odbc'"

DoCmd.Close acForm, "Open MCMS"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top