Connecting Tech Pros Worldwide Help | Site Map

how to check if table exists in Access with ADO?

G G
Guest
 
Posts: n/a
#1: Nov 12 '05
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!
Allen Browne
Guest
 
Posts: n/a
#2: Nov 12 '05

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]


Closed Thread