Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server Application Roles
Message
De
02/05/2001 22:28:57
 
 
À
02/05/2001 19:46:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00502767
Message ID:
00502850
Vues:
17
>I am the owner of the database. When I use the query analyzer the command works fine. It is when I try to access it through the application is when it blows up.
>
>Below is how I am accessing it:
>lnHandle = SQLCONN("DSN","Userid","password") I get my connection.
>lnExe = SQLEXE(lnHandle,"Exec sp_setapprole 'ROLE','Password'") This bombs it returns -1 for lnExe. lnHandle comes back with 1 so I have a connection.
>
>This code is run within an application.
>
>How do you set up your ODBC connection and fire up sp_setapprole?

This looks right to me. Have you checked with AERRORS()? Also, is it possible that you are not in the right database by using your DSN?

BTW, a gotcha I found using application roles. Once you've activated the application role for a connection, you can no longer access other databases in the same server, so commands such as SELECT * FROM OtherDatabase.dbo.TableName won't work anymore. It may not be a problem in your situation but it was a problem in mine so I thought I'd let you know that gotcha in case you didn't already knew.
Sylvain Demers
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform