Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RECORDSETCLONE NOT WORKING

Status
Not open for further replies.

SeanB

Programmer
Jul 19, 2001
70
0
0
US
Hello all. I have an ADP database that when opening the Form I set the recordset of the form.
Set Me.Recordset = rs

When I try doing a bookmark I am getting an error with Me.Recordsetclone that says "Active X Component can't create object" Any idea?

Here is the code:
Public Sub findrecordbyvalue(ByVal pOrdernumber As String, obj As Object)
Dim rs As ADODB.Recordset
Dim str1 As String
On Error GoTo findrecorderror
str1 = "ordernumber = '" & pOrdernumber & "'"
obj.Requery
Set rs = obj.RecordsetClone
rs.Find str1
If rs.EOF Then
rs.MoveFirst
End If
obj.Bookmark = rs.Bookmark

Exit Sub
findrecorderror:
MsgBox err.Description
If err.Number = 2115 Then
Set rs = obj.RecordsetClone
rs.Find str1
obj.Bookmark = rs.Bookmark
End If
End Sub
 
I have not see the "me.recordset used so I don't know if this is valid. However, is rs defined elsewere as a recordset?
Rob Freeman
rfreema1@ameritech.net
 
The explanation is quite simple:
The recordsetclone is a DAO.recordset, in ADO it does not exist. This explains the error message" Active X Component can't create object".

So simply add a reference to the DAO3.6 library and change ADODB.recordset to DAO.recordset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top