Friday, March 23, 2012

Invalid Object Name Error

Hi,
I have created a new database with a new table and when I try to access it
via ADO I get the InValid Object Name Error. It exists because I see in
Enterprise manager and I verfied the table name. Any ideas?
ThanksIf a user without dbo rights creates a table, it's owner is that user
instead of dbo. For example mydb.john.mytable. If you select from a table,
but do not specify the owner in the path, then it assumes the owner is 'dbo'
and considers the table mydb.dbo.mytable not to exist. Look closely in EM
and confirm that the 'owner' column says dbo for that table.
"Joe" <joew@.theemail.com> wrote in message
news:e584EROqFHA.564@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I have created a new database with a new table and when I try to access it
> via ADO I get the InValid Object Name Error. It exists because I see in
> Enterprise manager and I verfied the table name. Any ideas?
> Thanks
>|||Joe wrote:
> Hi,
> I have created a new database with a new table and when I try to
> access it via ADO I get the InValid Object Name Error. It exists
> because I see in Enterprise manager and I verfied the table name. Any
> ideas?
> Thanks
Are you sure you are in the correct database after you connect using
ADO? You can change/verify the database using the
Connection.DefaultDatabase property after you connect.
Also, is the object owned by dbo? If not, you need to specify the owner
name when accessing the object if you are connected using a user name
other than the owner.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Thanks for the post. The Connection.DefaultDatabase property is the correct
db and in Enterprise Manager shows that dbo is the owner. I am by
this.
Thanks
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:OBp4NlOqFHA.364@.TK2MSFTNGP11.phx.gbl...
> Joe wrote:
> Are you sure you are in the correct database after you connect using ADO?
> You can change/verify the database using the Connection.DefaultDatabase
> property after you connect.
> Also, is the object owned by dbo? If not, you need to specify the owner
> name when accessing the object if you are connected using a user name
> other than the owner.
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com|||Nevermind I am a dunce, it has been a long day. I was linking into the wrond
db (very similar in names due to testing).
Thanks
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:OBp4NlOqFHA.364@.TK2MSFTNGP11.phx.gbl...
> Joe wrote:
> Are you sure you are in the correct database after you connect using ADO?
> You can change/verify the database using the Connection.DefaultDatabase
> property after you connect.
> Also, is the object owned by dbo? If not, you need to specify the owner
> name when accessing the object if you are connected using a user name
> other than the owner.
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com

No comments:

Post a Comment