?
Solved

Error '80040e37': invalid object name - table can't be accessed

Posted on 2007-04-10
9
Medium Priority
?
4,654 Views
Last Modified: 2010-05-18
Hi

I have a single SQL Server 2000 database. I added some code to my website pages today to redirect people from certain IP addresses. The IP list is in the database in a table called tbl_IP_list. When I try and use the code, I get the following error on the ASP pages:

      Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
      [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'tbl_IP_List'.

The table is definitely there, but oddly it has a different owner listed. All the others have 'dbo' as the owner and this one has 'db_owner'.

I have run 'exec sp_tables' in Query Analyzer which lists the table fine; but if I try and access the contents via Query Analyzer it gives me a similar error:

      Server: Msg 208, Level 16, State 1, Line 1
      Invalid object name 'tbl_IP_list'.

I can access the table directly in Enterprise Manager with no problems at all - I've added and edited rows.

Is this a database owner issue? And if so, how can I change the database owner? I have tried 'exec sp_changeobjectowner 'tbl_IP_list', 'dbo'' in Query Analyzer but it doesn't seem to do anything.

0
Comment
Question by:Nicola-H
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 18881037
<<Is this a database owner issue? >>Seems so...what is the current owner of the object?  I suggest you put that owner in the command chain to *test* that it's an ownership problem.
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 18881043
<<I have tried 'exec sp_changeobjectowner 'tbl_IP_list', 'dbo'' in Query Analyzer but it doesn't seem to do anything.>>Does the session profile you are using have sufficient level of authority to change ownership.  Use sysadmin level and try to see why the ownership can't be changed...Hope this helps...
0
 
LVL 8

Expert Comment

by:MOA81
ID: 18881046
Dear Nicola-H

yes its an owner issue; the reason you are getting this error is that you are connecting using a user that has no access to this table.

are you an owner of the DB? if yes then you can adjusted the ownership of the object.

when you open the Enterprise manager

right click the table and click properties

then click on permissions

there you can adjust it

or another solution is manipulate your connection string so it uses a user name and password with sufficient rights

Regards
Mohammad O. Ali
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 1

Author Comment

by:Nicola-H
ID: 18881169
Thanks for the quick replies.

I can open the 'properties/permissions' tab, but there is no option to view or change the database owner in there. There is a list of users which is the same as for all the other tables.

I have limited access to this database as it's hosted remotely (Fasthosts) and there are dozens of other databases in their which I can't access. I can only play with the one I have been granted access to. I can't log in as anything other than the user I have been assigned for that one database.

Is there another way around this? I'm thinking that perhaps this table was created using a different software interface as I don't have SQL Server at home. I won't do that again.
0
 
LVL 8

Accepted Solution

by:
MOA81 earned 1000 total points
ID: 18881270
then just create another table with the user name you have fill the data and start referring to the new table
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 18881531
<<I can open the 'properties/permissions' tab, but there is no option to view or change the database owner in there. There is a list of users which is the same as for all the other tables.>>
You need to check the owner at object level for applicative ownership chains broken problems.
Make sure you have the sysadmin right level.  If you don't have it ask your dba to provide you with a solution.  
0
 
LVL 1

Author Comment

by:Nicola-H
ID: 18881743
"If you don't have it ask your dba to provide you with a solution.  "

I think that's supposed to be me.

I'm afraid Mohammad's answer may be the only practical solution - cut and paste into a new table. I can't even do a data export to Excel and then reimport as it won't let me select the table.
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 18881824
<<I think that's supposed to be me. >>
In that case I suggest you get a good book on SQL security.
0
 
LVL 1

Author Comment

by:Nicola-H
ID: 18881846
I'm not responsible for security at the top level because I'm using a third party hosting company, like I said above. I just administer one of the databases hosted on their SQL Server installation so don't have sysadmin access. I'll bear it in mind though.
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question