Recent

Author Topic: ODBC System DSN connected SQL_Server database error?  (Read 921 times)

Jonvy

  • Jr. Member
  • **
  • Posts: 90
ODBC System DSN connected SQL_Server database error?
« on: June 02, 2023, 11:21:02 am »
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?
Thanks!


Zvoni

  • Hero Member
  • *****
  • Posts: 2300
Re: ODBC System DSN connected SQL_Server database error?
« Reply #1 on: June 02, 2023, 11:37:55 am »
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
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Jonvy

  • Jr. Member
  • **
  • Posts: 90
Re: ODBC System DSN connected SQL_Server database error?
« Reply #2 on: June 02, 2023, 03:46:19 pm »
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?

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: ODBC System DSN connected SQL_Server database error?
« Reply #3 on: June 07, 2023, 02:18:22 pm »
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"?

 

TinyPortal © 2005-2018