How to set a RecordSet to be updateable

mmitchell

Registered User.
Local time
Today, 17:00
Joined
Jan 7, 2003
Messages
80
I can set my recordset to a stored procedures in my .ADP using this code:

Set rstHeaderStatusChange = CurrentProject.Connection.Execute("spSSHCDStatusHeirarchyLink")
But how do I code to make the recordset updatable? I tried: CurrentProject.Connection.Open but then Access wants some function info.

I am basically looping through the records and updating the data:
Code:
If rstHeaderStatusChange.BOF = False Then   'we found at least one record
                    rstHeaderStatusChange.MoveFirst
                  Do
                      rstHeaderTable.Find "[QuoteID]= " & rstHeaderStatusChange.Fields("QuoteID") & " AND [WOID]= " & rstHeaderStatusChange.Fields("WOID") & " AND [WOIDSub]= " & rstHeaderStatusChange.Fields("WOIDSub") & " AND [ECN]= " & rstHeaderStatusChange.Fields("ECN")
           
                     If rstHeaderTable.EOF = False Then ' ** found match
                       Do  'LOOP through all of the separate revisions that may be found for this work order.
                           With rstHeaderTable
                               
                               .Fields("StatusID") = rstHeaderStatusChange.Fields("Link")  'Change the header status to the link status for the current recrord
                               .Update
                           End With
                             rstHeaderTable.Find "[QuoteID]= " & rstHeaderStatusChange.Fields("QuoteID") & " AND [WOID]= " & rstHeaderStatusChange.Fields("WOID") & " AND [WOIDSub]= " & rstHeaderStatusChange.Fields("WOIDSub") & " AND [ECN]= " & rstHeaderStatusChange.Fields("ECN")
                        
                        Loop Until rstHeaderTable.EOF = True
                     End If
                        rstHeaderStatusChange.MoveNext
                  Loop Until rstHeaderStatusChange.EOF = True
            End If
        rstHeaderStatusChange.Close
        rstHeaderTable.Close

Also, do I need to close the recrodset since I am in an ADP or should they just be set to nothing?
 

Users who are viewing this thread

Back
Top Bottom