ADO or DAO??

Could someone please tell me where I determine which one I am using? Which one should I be using? How do I tell it which one to use? I have looked at every menu in the software and I cannot find it to save my life. Also, does anyone know where there is a step by step explanation of how to use either?


Who is Participating?
inthedarkConnect With a Mentor Commented:
ADO is not realy what it pretends to be. It is meant to be a common interface to any compliant back-end server.  But they left out all of the important stuff. Like common way of getting the value of the last inserted record Indetity/Autonumber field.  Users and groups were also missout out too.  However, if your back-end is Access you can set a reference to ADOX (Microsoft ADO Ext 2.5 for DLL & Security).

It is easy to use and kinda works like this:

Dim aCat as ADOX.Catalog

set aCat = New ADOX.Catalog
Set ADOX.ActiveConnection = CN ' you open connection

I think you can now create new Users and groups and append them to aCat.Users etc.  I have only used ADOX to create/amend tables but it is realy simple to use.

Private Sub Command1_Click()

Dim CN As ADODB.Connection
Dim aCat As ADOX.Catalog

' open connection
Set CN = New ADODB.Connection
CN.ConnectionString = "..."

' get access to catalog
Set aCat = New ADOX.Catalog
Set aCat.ActiveConnection = CN

' Create a Group
Dim aGroup As ADOX.Group
Set aGroup = New ADOX.Group
aGroup.Name = "Accounts"

' Create a user
Dim aUser As ADOX.User
Set aUser = New ADOX.User
aUser.Name = "Jim"
aUser.Groups.Append "Accounts"
aCat.Groups.Append aUser, "MyPassword"

End Sub

Welcome to the "Confused By Microsoft" room!

You need to make friends the Project References.  Click on project, then select References.  You can select a whole bunch of stuff here/  If you are using DAO you should have Microsoft DAO 3.6 selected.  If using ADO Microsoft Activerx Data Objects 2.x will be selected.

Take Drifter88zxtW's advice and use ADO.  Not because its better, in fact it is slower, but becuase Microsoft are trying to drop DAO. So for new apps you don't have a choice use ADO.

Hope this helps:~)

p.s. Now all you have to do is work out how to use it.......

Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

madugasAuthor Commented:
Does ADO support Multiple Users and User Groups? I got the impression from MicroSoft's web site that it currently does not.
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
Moderator, my recommended disposition is:

    Accept inthedark's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
All Courses

From novice to tech pro — start learning today.