PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WD7.5 and SQL SERVER
WD7.5 and SQL SERVER
Débuté par Paulo Oliveira, 20 juin 2003 19:48 - Aucune réponse
Posté le 20 juin 2003 - 19:48
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".