Connecting Tech Pros Worldwide Help | Site Map

how to check if table exists in Access with ADO?

  #1  
Old November 12th, 2005, 10:56 PM
G G
Guest
 
Posts: n/a
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, 10:56 PM
Allen Browne
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error checking while inserting records in access hakkatil answers 2 September 4th, 2008 07:29 PM
VB Scripts in Access Tables Adam Turner via AccessMonster.com answers 46 November 13th, 2005 03:31 PM
'VB in Access' and SQL: Library Management Sameer answers 4 November 13th, 2005 02:02 PM
how to check if table exists in Access with ADO? G G answers 7 November 12th, 2005 11:20 PM