ACC2000: Error with Subform Based on Hierarchical ADO RecordsetID: Q199113
|
When you use the MSDatashape provider to create a hierarchical recordset, and you then assign the recordset to a subform, you may receive the following error message:
Run-time error '2147417848(80010108)':
Method 'Recordset' of object '_Form_<form name>' failed
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
Microsoft Access 2000 exposes a new Recordset property for forms through which you can assign a recordset to a form. ActiveX Data Objects (ADO) allows you to create hierarchical, or chaptered, recordsets where each row in a recordset contains a recordset with related child records (such as the subdatasheets in tables).
Sub Form_Open(Cancel As Integer)
Dim cn As New ADODB.Connection
Dim rsCategories As New ADODB.Recordset
Dim rsProducts As ADODB.Recordset
Dim strSQL As String
cn.Provider = "MSDataShape"
cn.Open "DATA PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE = " & _
"C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb"
strSQL = "SHAPE {SELECT * FROM Categories} APPEND " & _
"({SELECT * FROM Products} As rsProducts RELATE CategoryID TO " & _
"CategoryID)"
rsCategories.Open strSQL, cn, adOpenKeyset, adLockOptimistic
Set Me.Recordset = rsCategories
Set rsProducts = rsCategories("rsProducts").Value
Set Me![Products Subform].Form.Recordset = rsProducts
End Sub
Run-time error '2147417848(80010108)':
Method 'Recordset' of object '_Form_Products subform' failed.
Additional query words: pra chapter shape
Keywords : kberrmsg kbdta AccessCS
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: June 2, 1999