Forum > Databases

ODBC System DSN connected SQL_Server database error?


Dear all,
I use SQLdb TODBCConnection connected Win10 OS System DSN for SQL_Server database, but when I run query in my program, it gives me exception:
The SELECT permission was denied.

Actually for this System DSN, it has READ/WRITE permission for the database, and in the same PC, another software use this DSN connection, it can work well both for SELECT ,UPDTATE,INSERT etc.

I'm new for ODBC connection, is there any option should added to the code, so it can work?

Can anyone help me?

The only thing coming to mind are missing GRANTS for the connected User/Role, which wouldn't have anything to do with the DSN itself

Yes, I'm also think it comes from GRANTS, because the SQL Server verify the authenticity with integrated windows authentication.

I'm running my program with the correct user logon on windows, same user as the other software can access the database.

But how to let the SQL Server database know my program running with granted user? Or how to GRANTS my program?

As the error message states there are insufficient permissions on table "T_QUALPF" in database "TRACING_V3".
What is your connection string used in TODBCConnection? UserName, Password, Params?
Do you use Trusted_Connection=Yes?
Are really to current windows user granted select permissions on object "T_QUALPF"?


[0] Message Index

Go to full version