Solved

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

Posted on 2007-04-10
9
4,143 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

820 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