HighTechTalks DotNet Forums  

OdbcExcetion : Problem with tables access.

Dotnet Framework (ODBC.net) microsoft.public.dotnet.framework.odbcnet


Discuss OdbcExcetion : Problem with tables access. in the Dotnet Framework (ODBC.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
chofra03
 
Posts: n/a

Default OdbcExcetion : Problem with tables access. - 01-06-2005 , 02:37 PM






Hi,

I'm currently trying to retrieve information from a specific table within a
SQL Database using the following code:

Dim oOdbcCommand As New Odbc.OdbcCommand
oOdbcCommand.CommandType = CommandType.Text
oOdbcCommand.Connection = mOdbcConnection
oOdbcCommand.CommandText = "SELECT * FROM SOMETABLE"

Dim oOdbcReader As Odbc.OdbcDataReader
oOdbcReader = oOdbcCommand.ExecuteReader
oOdbcCommand.Dispose()

Connection to the SQL Database is performed like this :

strConnection = "Driver={SQL Server}" & _
";Server=" & mServerName & _
";Database=" & mDatabaseName & _
";Uid=" & mUserID & _
";Pwd=" & mPassword & ";"

mOdbcConnection = New Odbc.OdbcConnection(strConnection)
mOdbcConnection.CreateCommand()

While performing the query with the SOMETABLE owner mUserID, there is no
problem accessing the SOMETABLE information.

Therefore, while performing the query with the Database System Administrator
and DB owner mUserID, I'm unable to access the SOMETABLE information getting
the Invalid Object Name 'SOMETABLE' error message.

If I tried to perform the same thing using EXCEL query, the SOMETABLE
information could be accessed by both mUserID which is not the case with my
application.

It seems that only the SOMETABLE owner could access the table. Why the
Database System Administrator and DB owner could not access the SOMETABLE? Am
I doing something wrong while connecting to the Database? Do I have to change
permissions? Why is it working with EXCEL and not with my application?

Thanks


--
Francois Chouinard


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.