I too have been having that problem and I'm not finding any answers in Microsofts
documentation or on there bugs site (msdn.microsoft.com/bugs). I did come
up with a work around. (There may be a real solution out there but I've
wasted too much time researching and need to continue on with the project).

The way I fixed this was to iterate through each chapter and do a batch update
against each one. This will force the error to the surface, especially on
inserts.

Dim rs As ADOR.Recordset
Dim rsChild As ADOR.Recordset
...

rs.MoveFirst
While Not rs.EOF
Set rsChild = rs("chapMenu").Value
rsChild.UpdateBatch adAffectAll
rs.MoveNext
Wend
...


In your child recordset all the columns of the primary key must be selected
for the table you want update. Don't pick the columns from the table you
don't want to update or insert into. Also you should set the property "Unique
Table" to the name of the table that is to be update/inserted/deleted. Do
the same for "Unique Catalog" and "Unique Schema". I do this immediately
after I query and only to the first chapter, it seems to propigate down to
every chapter so don't bother doing this to each one. The reason I specifically
leave out the columns of the primary key to the table I don't want to update
is that even though you set the "Unique Table" property to the table you
want to update it doesn't really care and will update the both tables. If
there are not enough fields to resolve the primary key in that table it will
only update the other table - at least this is true for SQL Server 7.0.
(Underneath I think it just isn't pulling back the rowid for both tables
in the join claus.) From here all you just have to handle the errors.

Below is my batch update procedure from my data services layer. (No transactions
although it runs under MTS). I use it for both standard and hierarchical
recordsets. If you ever come across the real solution, let me know.



Option Explicit

Implements ARSInterfaces.IWriteData

Private Function IWriteData_Update(ByVal Params As Variant, BusnData As Variant,
ReturnError As Variant) As Long

Dim rs As ADOR.Recordset
Dim rsChild As ADOR.Recordset
Dim con As ADODB.Connection

On Error GoTo Errorhandler

Set rs = BusnData
Set con = New ADODB.Connection

'determine if the recordeset is heirarchical or not
If Len(rs.Properties("Reshape Name").Value) = 0 Then
' non-hierarchical, use the data file
con.ConnectionString = "File Name=" & App.Path & "\ARS.udl;"
con.Open
Else
' hierarchical, use the DSN and shape provider
con.Provider = "MSDataShape"
con.Open "Data Source=ARS;Data Provider=MSDASQL"

End If


Set rs.ActiveConnection = con
rs.UpdateBatch adAffectAllChapters

' If hierarchical each chapter has to be updated seperately
If Len(rs.Properties("Reshape Name").Value) > 0 Then
rs.MoveFirst
While Not rs.EOF
Set rsChild = rs("chapMenu").Value
rsChild.UpdateBatch adAffectAll
rs.MoveNext

Wend
End If


Exit Function
Errorhandler:

IWriteData_Update = Err.Number
Debug.Print Err.Number & " " & Err.Description
Select Case Err.Number
Case -2147217900 ' constraint error
App.StartLogging App.Path & "\error.log", vbLogToFile
App.LogEvent "CBatchUpdate " & Params & Err.Description, vbLogEventTypeError
rs.MoveNext
Resume

Case Else
' MsgBox Err.Description
' Resume
'Raises the error to be trapped so the rejects can be trapped
App.StartLogging App.Path & "\error.log", vbLogToFile
App.LogEvent "CBatchUpdate " & Params & Err.Description, vbLogEventTypeError
End Select

End Function





"Therese" <Therese.Lewis@mediware.com> wrote:
>
>Hi All,
>
>I am having a problem getting the child-part of a hierarchical recordset
>to
>update. I have created a hierarchical recordset using the SHAPE command.
>The data is retrieved properly for the parent and child values. However,
>when I update the recordset, only the parent values are updated in the
>database, while the child records remain unchanged. No errors are being
>generated, and the recordset continues to show the child records as changed,
>until it is re-retrieved from the database.
>
>I am using the Informix ODBC driver v. 3.31 as the datasource.
>
>I don't know what part is failing. Has anyone had this problem or know

what
>the problem may be?
>
>Any help is appreciated,
>Therese
>
>