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

Start loop from a specified point

Status
Not open for further replies.

penguinspeaks

Technical User
Nov 13, 2002
234
US
I am trying to automate an order based on my input.
If I enter a 5, for example, I want the rest of the records to auto-update. So the next record to meet the criteria would be
6, the next 7, and so on.

Code:
SET INFO1 = CONN.EXECUTE("SELECT * FROM SONGS1 WHERE ID ="&VARID&"")
VARNO = INFO1("setlist_order")

varorder is the number entered on my form. I want the records that follow to be updated.

I = VARORDER +1
DO UNTIL INFO1.EOF
SQL = "UPDATE SONGS1 SET setlist_order = "&I&" where CURRENT_SET = 1" ----  This is where I want to start with the record following the one that 2was updated.
	CONN.EXECUTE (SQL)
	I = I + 1
INFO1.MOVENEXT
LOOP
This is not updating anything after the record that is being updated from my form.
This isn't a public site so I am not concerned with injection.

Thanks,
Penguin
Please keep in mind that I am using classic ASP with MySQL database. Not sure if that information helps or not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top