Solved

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

Posted on 2007-04-10
9
3,733 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
Comment Utility
<<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
Comment Utility
<<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
Comment Utility
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
Comment Utility
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 8

Accepted Solution

by:
MOA81 earned 250 total points
Comment Utility
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
Comment Utility
<<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
Comment Utility
"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
Comment Utility
<<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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

771 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

10 Experts available now in Live!

Get 1:1 Help Now