Connecting Tech Pros Worldwide Help | Site Map

how to check if table exists in Access with ADO?

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 09:56 PM
G G
Guest
 
Posts: n/a
Default how to check if table exists in Access with ADO?

I need to check if a table exists in Access using ADO externally. I
tried

"Select Name from MSysObjects Where Name = 'myTable'"

with the ADO command object, but I got an error than I don't have
permission to read MySysObjects. Is there another way to check without
having to use On Error Resume Next?

Thanks,
GG



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

  #2  
Old November 12th, 2005, 09:56 PM
Allen Browne
Guest
 
Posts: n/a
Default Re: how to check if table exists in Access with ADO?

ADO is only half the story. For information on the database schema, you need
the ADOX library so you can examine the Tables collection of the Catalog.

Unfortunately, ADOX is really half-baked and unreliable.

It should be possible to read MSysObjects though (unless you are blocked by
MDW security).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"G G" <anonymous@discussions.com> wrote in message
news:4097c919$0$202$75868355@news.frii.net...[color=blue]
> I need to check if a table exists in Access using ADO externally. I
> tried
>
> "Select Name from MSysObjects Where Name = 'myTable'"
>
> with the ADO command object, but I got an error than I don't have
> permission to read MySysObjects. Is there another way to check without
> having to use On Error Resume Next?[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.