Programming Outlook to add a record to an Access DB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm IN Outlook. I've seen tons of examples on how to program Access to
manipulate Outlook but a few archaic examples from Outlook, none of which I
can understand.

I'd like to use ado because I know it.

I'll try anything right now. The DAO.Recordset object won't work with

Dim rs as DAO.Recordset
or
Dim rs
Set rs = CreateObject("DAO.RecordSet")

Something with this CreateObject method that's needed in Outlook

Any suggestions would be greatly welcomed.
 
When you say "The DAO.Recordset object won't work", do you mean that you're
getting a "user-type not defined" error?

If so, the problem is likely that you haven't set a reference to DAO. While
in the VB Editor with no code running, select Tools | References from the
menu bar, scroll through the list of available references until you find the
entry for Microsoft DAO 3.6 Object Library, select it, then exit the dialog.

Also, the DAO model is different than the ADO. DAO Recordsets don't have an
existence of their own: you can't use CreateObject to instantiate one.
Instead, you need to use the OpenRecordset method of either the Database or
QueryDef objects.
 
Thank you.

Douglas J. Steele said:
When you say "The DAO.Recordset object won't work", do you mean that you're
getting a "user-type not defined" error?

If so, the problem is likely that you haven't set a reference to DAO. While
in the VB Editor with no code running, select Tools | References from the
menu bar, scroll through the list of available references until you find the
entry for Microsoft DAO 3.6 Object Library, select it, then exit the dialog.

Also, the DAO model is different than the ADO. DAO Recordsets don't have an
existence of their own: you can't use CreateObject to instantiate one.
Instead, you need to use the OpenRecordset method of either the Database or
QueryDef objects.
 
Back
Top