Invalid Object 'TABLE' ERROR

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Hi,

Just a question here, since you are posting in ado.net newsgroup:
Why don't you use managed Sql provider rather then ODBC one?
 
Hi,

It's the same problem with the managed SQL provider.

I used ODBC in my exemple since I could select the same file with Excel to
make it work properly with both user ID.

Francois.

Miha Markic said:
Hi,

Just a question here, since you are posting in ado.net newsgroup:
Why don't you use managed Sql provider rather then ODBC one?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

chofra03 said:
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
 
Back
Top