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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return Rows Affected Value 1

Status
Not open for further replies.

dazzer123

IS-IT--Management
Nov 24, 2003
128
GB
I'm running a stored procedure in my VBA that runs an Update Query based on certain parameters.

I would like the VBA to then return how many rows were affected by the Update yet I am unsure how to do this.

Does anyone have any ideas?
 
Assumes an ADODB Recordset. Example.

Dim sql1 As String, recsAffected As Integer, audID As Long
Dim cnt As Integer
sql1 = "Update dbo_Epic_TrackPayorProviderTpins Set " & _
"EpicExtractFlag = '1' " & _
"Where AuditID = " & audID
cn.Execute sql1, recsAffected

Debug.Print "records updated = "; recsAffected; " for AuditID = "; audID
 
Thanks for your help, i'll give this a go
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top