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!

Applicaton role with ADODC

Status
Not open for further replies.

jobyk

Programmer
Jun 24, 2001
19
IN
Hi All

How can I implement SQL Application role with ADODC.

Thanks in Advance
Joby
 
Frist you grant the application role to users (groups).

The application must execute sp_setapprole with approlename and password to activate the app role. The application has to get the password from somewhere, hardcoded maybe, or ask the user - this is an issue I have never been satisfied with.
 
If memory serves me, the ADODC has a connection string as a property and will use that connection string to connect to the database and then execute the query and make the results available.
This would mean that all queries would have to be 2 part:
first to set the application role;
second to do the actual query.
Obviously this is not such a good idea and rather impractical. Seeing as how you are using ADO you could write a central function, that uses a connection that already has set the application role, and get it to return a recordset, this recordset can then be set to be the ADODC's recordset.
In VB6 it would be something like this:
Code:
Set ADODC1.recordset = mysqlfunction(mysql)

I hope this helps.

-- Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top