Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with VFP connections and SQL store procedures
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01056694
Message ID:
01056726
Views:
27
Are your views set up to share connection?

>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.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform