Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-04-10
9
Medium Priority
?
4,881 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

604 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