Forum Moderators: open

Message Too Old, No Replies

Return a transaction count

         

txbakers

5:19 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When I use sql commands from the command line to mySQL I get a response telling me how many records were affected.

In ASP I can get the RecordCount property of the object to tell me how many records I've pulled with a Select query.

Is there a way to get the "updated record count" or "deleted record count" if I do a mass update or delete from ASP?

RossWal

6:18 pm on Jan 8, 2004 (gmt 0)

10+ Year Member



I've never used mySQL, but an obvious hack would be to issue a select count(*) with the same where predicates you'll be using for the delete or update. Not pretty, nor efficient though.

txbakers

7:17 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks. Not efficient, pretty or totally accurate. If for some reason the update fails we should know about it too.

I'm sure the answer is out there somewhere in ADO land.

aspdaddy

7:31 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Any good?
[support.microsoft.com...]

txbakers

7:44 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Better than good - great - exactly what i was looking for. I should visit the msdn site more often.

txbakers

8:19 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



actually, it's what I want, but I didn't get it to work yet. Still fussing with it.

It always returns an integer of 0, even though I've updated 2 records.

I'll keep playing an dpost the results.

aspdaddy

11:56 am on Jan 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also try a search at aspfaq.com, I think there is some info about doing this, have a feeling something to do with using a recordset on updates to properly return the recordsAffected value