0

There are 2 columns in 1 database for Id and name but the serial number is random.


I want to update those serial number in serial order, how to?

Like

id Name
------------
1 Shouvik
5 Joe
6 Mathew
3 John
4 James
2 Jack


I want to update it like

id Name
------------
1 Shouvik
2 Joe
3 Mathew
4 John
5 James
6 Jack

if i code it like

for x=1 to 4
conndb.execute "update tblcontest set id=" & x 
rs2.movenext
next

This way its updating all the colum with the number 4 only, any ideas?

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by cancer10
0

Actually you are updating all records each time you loop in the code.

First you set all records to 1 then loop and set all records to 2 and so on….

The question would be is what does rs2 recordset contain
and is serial number the ID field?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.