How to convert DAO to ADO

  • Thread starter Thread starter Lucky
  • Start date Start date
L

Lucky

I need to create in ADO function that works like
DoesObjectExist (Microsoft Knowledge Base Article -
210598).

I can get through tables (simple, TableDef is Tables in
ADO), after that I am stuck in finding corresponding ADO
values/parameters for QueryDef, etc.

Example:
Case "Queries"
For Each qry In dbs.QueryDefs
If qry.Name = objName Then
objExists = True
Exit Function
End If
Next qry

How do I convert this and similar code for forms,
reports, modules to ADO?

Your help or ideas are greatly appreciated.

Lucky
 
ADO is a data access protocol. It doesn't know anything about Forms, Reports
or Modules.

What you can do is look at the AllForms, AllReports, All Macros and
AllModules collections which are part of the Access.CurrentProject object.
You can also look at the AllTables and AllQueries collections which are part
of the Access.CurrentData object.
 
TableDef is NOT ADO but DAO. Use SysCmd or
CurrentData.AllQueries

SysCmd(acSysCmdGetObjectState, acForm, "Switchboard") = 1

If Len(Application.CurrentData.AllQueries(QueryName).Name)

Steve King
 

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

Similar Threads

Convert from DAO to ADO 7
QueryDefs - DAO vs ADO 4
ADO -DAO problem 1
Access 2007 - whatever happened to ADO and DAO ? 4
ADO vs DAO in Access 2007 8
ADO vs DAO 1
DAO / ADO 11
ADO interaction with TableDefs. 4

Back
Top