|
-
Feb 5th, 2002, 01:41 AM
#1
Thread Starter
New Member
How to detect how many records are updated??
I've the following codes in my program to update some records in a table, based on some conditions.
------------------------------------------------------------------------
sql = "update tbl_cust set dept_id = '" & dept_id_new & "' where dept_id = 'A'"
Set rs = conn.Execute(sql)
------------------------------------------------------------------------
I want to find out the number of records updated after executing the above command, is it possible? Or is there an alternative way of finding out the number of records updated??
Really desperate, please help, thanks in advance.
-
Feb 5th, 2002, 02:02 AM
#2
Fanatic Member
well here's a long way
u retreive a recordset of the records that need to be updated, look at the recordcount, change the required values in the recordset and update...
-
Feb 5th, 2002, 02:59 AM
#3
Addicted Member
VB Code:
Dim Affected as Long
sql = "update tbl_cust set dept_id = '" & dept_id_new & "' where dept_id = 'A'"
conn.Execute sql,Affected
Debug.print Affected
-
Feb 5th, 2002, 06:02 AM
#4
Thread Starter
New Member
How to detect how many records are updated??
Originally posted by Pickler
VB Code:
Dim Affected as Long
sql = "update tbl_cust set dept_id = '" & dept_id_new & "' where dept_id = 'A'"
conn.Execute sql,Affected
Debug.print Affected
Oh yes Pickler ! What you've recommended is exactly what I want!! Thank you so much.
Thanks to you too, SkinLab.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|