Solved

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

Posted on 2007-04-10
9
3,895 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
  • 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
 
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 8

Accepted Solution

by:
MOA81 earned 250 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now