Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with VFP connections and SQL store procedures
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Help with VFP connections and SQL store procedures
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
MS SQL Server
Divers
Thread ID:
01056694
Message ID:
01056694
Vues:
76
I need execute a "SQL Server store procedure" assigned to Id handler used by "VFP DBC connection". It doesn't work, or rather, it doesn't returns any error, but neither apply the "store procedure".

The "store procedure" is "SQL Server application role" it grants privileges to session ID on all tables of a database.

The code:
OPEN DATABASE myVFPdatabase
USE rvUsers  && remote view to SQL Server 'users' table with all grants
myHandler = CURSORGETPROP("ConnectHandle","rvUsers")
SQLEXEC(myHandler, "exec sp_setapprole 'userPower', 'myStrongPwd'")
USE rvSales  && remote view to SQL Server 'users' table now with grants applied by sp_setapprole
*-- Error here, no grants to use 'sales'table (select, etc.)
It works using SQL pass through:
myHandler = SQLCONNECT("myConn","myUser","myPwd")
SQLEXEC(myHandler,"select * from sales")
*-- Errorhere, no grants on 'sales'
SQLEXEC(myHandler, "exec sp_setapprole 'userPower', 'myStrongPwd'")
SQLEXEC(myHandler,"select *from sales")
*-- Ok, works fine!
Any idea ?
Thanks in advance

I'm using VFP 8 SP1, but using VFP9 ASQLHANDLES() neither works.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform