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

Getting the number of rows affected by com.execute?

Status
Not open for further replies.

joebickley

Programmer
Aug 28, 2001
139
GB
Hi

I am passing an update statement into command. How can i get back the number of rows that were affected by the update statement?

Thanks

Joe

PS code....
dim com as command
com.CommandText = "UPDATE tblDANs SET DANStatus = xx WHERE DANnumber=yy"
com.Execute
 
msgbox dsum("DANumber","tblDANS", "DANumber = yy")

this will not give the number in yy but 'yy'. To get the number in "yy" you must to an & yy & ")"

rollie@bwsys.net
 
The execute will pass back the records affected. I believe it is the second parm on the execute.

Dim numUpdated as Long

com.Execute , numUpdated

I know this works assuming the sql string is okay.
Dim sql1 as string

sql1 = "UPDATE tblDANs SET DANStatus = xx WHERE DANnumber =yy"
com.execute sql1, numUpdated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top