Thread: OpenRecordset
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default OpenRecordset

"Fred" <leavemealone@home wrote ...

I copied an example program from the microsoft help on OpenRecordset.
The problem is it does not even compile. It stops on "Set rstTemp2 =
rstTemp.OpenRecordset()" with OpenRecordset highlighted and the message
"Method or data member not found"

Currently I have the following references checked:
Visual Basic for Applications
Microsoft Excel 8.0 Object Library
OLE Automation
Microsoft Forms 2.0 Object Library
Microsoft ActiveX Data Objects 2.5 Library
Microsoft DAO 3.6 Object Library


In the list, ADO is of higher priority than DAO. Therefore, without
qualifying your objects with their respective class names, the line

Dim rstTemp As Recordset

is assumed to be an ADO recordset which doesn't have an OpenRecordset
method.

Try adding the DAO class name for this and all other relevant lines
e.g.

Dim rstTemp As DAO.Recordset

But TK is right, ADO is a better bet for someone just starting out.

Jamie.

--