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 ?