Asp/SQL server error when querying table

R

Rasta

Hi, I've created a new table in a SQL Server db called 'LGBProdDetails' and
I keep getting an error from my asp page that queries the table The error
is:

Category=Microsoft OLE DB Provider for ODBC Drivers
Brief Description =[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid
object name 'LGBProdDetails'.
COM Error Number =-2147217865 (0x80040E37)

I know I have the name correct and I can query it with query analyzer using
the same query as the one in the asp pag. I'm wondering if it is a
permissions issue. When I try to look at the properties and permissions for
this table I get an error 'select permission denied on object 'syslogins',
database, 'master' owner 'dbo'. Do I need to be logged in as 'dbo' to
create a table and set permissions. The account I was logged in as when I
created the table is listed in the 'roles' diaglog box for db_owner so
shouldn't it have the same rights as the dbo? If you have any ideas I'd
really appreciate your feedback.
 
B

Bob Barrows [MVP]

Rasta said:
Hi, I've created a new table in a SQL Server db called
'LGBProdDetails' and I keep getting an error from my asp page that
queries the table The error is:

Category=Microsoft OLE DB Provider for ODBC Drivers
Brief Description =[Microsoft][ODBC SQL Server Driver][SQL
Server]Invalid object name 'LGBProdDetails'.
COM Error Number =-2147217865 (0x80040E37)

I know I have the name correct and I can query it with query analyzer
using the same query as the one in the asp pag. I'm wondering if it
is a permissions issue. When I try to look at the properties and
permissions for this table I get an error 'select permission denied
on object 'syslogins', database, 'master' owner 'dbo'. Do I need to
be logged in as 'dbo' to create a table and set permissions. The
account I was logged in as when I created the table is listed in the
'roles' diaglog box for db_owner so shouldn't it have the same rights
as the dbo? If you have any ideas I'd really appreciate your
feedback.

I suspect that the table's owner is not "dbo". When the table as an owner
that is not dbo, then you have to explicitly qualify the table's name when
logged in with an account that is not the table's owner:

table's owner: login1
logged in as: login1
succeeds:
select * from tablename

logged in as: login2
fails:
select * from tablename
succeeds:
select * from login1.tablename


Bob Barrows
 
R

Rasta

Thanks a bunch - that was it!
Bob Barrows said:
Rasta said:
Hi, I've created a new table in a SQL Server db called
'LGBProdDetails' and I keep getting an error from my asp page that
queries the table The error is:

Category=Microsoft OLE DB Provider for ODBC Drivers
Brief Description =[Microsoft][ODBC SQL Server Driver][SQL
Server]Invalid object name 'LGBProdDetails'.
COM Error Number =-2147217865 (0x80040E37)

I know I have the name correct and I can query it with query analyzer
using the same query as the one in the asp pag. I'm wondering if it
is a permissions issue. When I try to look at the properties and
permissions for this table I get an error 'select permission denied
on object 'syslogins', database, 'master' owner 'dbo'. Do I need to
be logged in as 'dbo' to create a table and set permissions. The
account I was logged in as when I created the table is listed in the
'roles' diaglog box for db_owner so shouldn't it have the same rights
as the dbo? If you have any ideas I'd really appreciate your
feedback.

I suspect that the table's owner is not "dbo". When the table as an owner
that is not dbo, then you have to explicitly qualify the table's name when
logged in with an account that is not the table's owner:

table's owner: login1
logged in as: login1
succeeds:
select * from tablename

logged in as: login2
fails:
select * from tablename
succeeds:
select * from login1.tablename


Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top