PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → WD7.5 and SQL SERVER
WD7.5 and SQL SERVER
Started by paulo.oliveira, Jun., 20 2003 7:48 PM - No answer
Posted on June, 20 2003 - 7:48 PM
I'm using native access to sql server and I need to use application roles
in the database.
The only way of I know of using stored procedure is using sqlconnect and
sqlexec, but a want to use hffunctions and I'm using hopenconnection.
Is there a way to use application roles (store procedure)with hopenconnection
?

The code i'm using is :

HDescribeConnection("SQLSRV", "", "",SERVER, DB,...
hNativeAccessSQLServer, hOReadWrite, "")
IF NOT HOpenConnection("SQLSRV") THEN
Error(HErrorInfo())
EndProgram
END
IF NOT HChangeConnection("*","SQLSRV") THEN
Error(HErrorInfo())
EndProgram
END
IF NOT sqlexec("EXEC sp_setapprole @rolename='app_role',... @password='password'","sql_role")
THEN
ERROR(HErrorInfo())
EndProgram
END

In this case i'm getting one error in sqlexec saying "No current connection".