Hello,
I created a ADO.Recordset and set fields. After it, I tried to fill my recordset.
Now, I want to assign this recordset a Subform
(in Access 2000).
But I got a exception "7965: ... Ungültiges Objekt ..."
means like invalid object.
I attach for this purpose a sample code.
-----------SAMPLE-------------------
'Create a offline Recordset
Set myRS = New ADODB.Recordset
With myRS
.ActiveConnection = Nothing
.CursorLocation = adUseClient
.LockType = adLockBatchOptimistic
End With
'insert a Field
myRS.Fields.Append "CITY", adVarChar, 20, adFldMayBeNull
'Open recordset
myRS.Open
'Fill recordset
myRS.AddNew
myRS.Fields("CITY"
.Value = "Berlin"
myRS.AddNew
myRS.Fields("CITY"
.Value = "Frankfurt"
'try to assign recordset raises an exception
Set Form_Formular3.Recordset = myRS '<-raises exception
--------------------------------------------------------
What is wrong here?
Thanks!
I created a ADO.Recordset and set fields. After it, I tried to fill my recordset.
Now, I want to assign this recordset a Subform
(in Access 2000).
But I got a exception "7965: ... Ungültiges Objekt ..."
means like invalid object.
I attach for this purpose a sample code.
-----------SAMPLE-------------------
'Create a offline Recordset
Set myRS = New ADODB.Recordset
With myRS
.ActiveConnection = Nothing
.CursorLocation = adUseClient
.LockType = adLockBatchOptimistic
End With
'insert a Field
myRS.Fields.Append "CITY", adVarChar, 20, adFldMayBeNull
'Open recordset
myRS.Open
'Fill recordset
myRS.AddNew
myRS.Fields("CITY"
myRS.AddNew
myRS.Fields("CITY"
'try to assign recordset raises an exception
Set Form_Formular3.Recordset = myRS '<-raises exception
--------------------------------------------------------
What is wrong here?
Thanks!