G
Guest
Here a overview of my problem:
Let say that I have the following DSN files:
For user1
[ODBC]
DRIVER=SQL Server
UID=purreq
PWD=password
Network=DBMSSOCN
DATABASE=DB
WSID=COMPUTER90
APP=Microsoft Office 2003
SERVER=192.168.0.19
For user2:
[ODBC]
DRIVER=SQL Server
UID=privuser
PWD=password
Network=DBMSSOCN
DATABASE=DB
WSID=COMPUTER90
APP=Microsoft Office 2003
SERVER=192.168.0.19
Then, assume that the table I want to access on SERVER is named ACCOUNT. The
owner of the ACCOUNT table is UID-privuser
Both user have full permission on ACCOUNT (privuser) table.
Permit in Database role for UID=purreq is public and db_owner
Permit in Database role for UID=privuser is public and db_datareader
While using both DSN files within Microsoft Excel to perfom Database Query,
no problem is encountered. Data could be fully retrieved from the ACCOUNT
table.
While using my application, by connecting to the SQL server using the
following connection string:
"FileDsn=C:\Program Files\Common Files\ODBC\Data Sources\userX.dsn"
Only UID=privuser (user2.dsn) who is the owner of the table could access the
ACCOUNT table. Otherwise UID=purreq (user1.dsn) got the 'Invalid Object Name
'ACCOUNT'' error message while trying to perform the ExecuteReader() method.
Thanks for your support and if you need further information, just let me know.
F. Chouinard
Let say that I have the following DSN files:
For user1
[ODBC]
DRIVER=SQL Server
UID=purreq
PWD=password
Network=DBMSSOCN
DATABASE=DB
WSID=COMPUTER90
APP=Microsoft Office 2003
SERVER=192.168.0.19
For user2:
[ODBC]
DRIVER=SQL Server
UID=privuser
PWD=password
Network=DBMSSOCN
DATABASE=DB
WSID=COMPUTER90
APP=Microsoft Office 2003
SERVER=192.168.0.19
Then, assume that the table I want to access on SERVER is named ACCOUNT. The
owner of the ACCOUNT table is UID-privuser
Both user have full permission on ACCOUNT (privuser) table.
Permit in Database role for UID=purreq is public and db_owner
Permit in Database role for UID=privuser is public and db_datareader
While using both DSN files within Microsoft Excel to perfom Database Query,
no problem is encountered. Data could be fully retrieved from the ACCOUNT
table.
While using my application, by connecting to the SQL server using the
following connection string:
"FileDsn=C:\Program Files\Common Files\ODBC\Data Sources\userX.dsn"
Only UID=privuser (user2.dsn) who is the owner of the table could access the
ACCOUNT table. Otherwise UID=purreq (user1.dsn) got the 'Invalid Object Name
'ACCOUNT'' error message while trying to perform the ExecuteReader() method.
Thanks for your support and if you need further information, just let me know.
F. Chouinard