Groups | Blog | Home
all groups > inetserver asp general > november 2003 >

inetserver asp general : Listing Numbers



Aaron Bertrand [MVP]
11/30/2003 1:52:43 PM
Please don't multi-post. I answered this in another group...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/




[quoted text, click to view]

Oli
11/30/2003 6:46:44 PM
Hi

I have 2 textboxes - "from" & "to".

Assume I enter number 1 in "from" and 10 in "to" - I want the ASP to return:
1,2,3,4,5,6,7,8,9,10 and insert this into an Access database over 10 rows
into the 'number' field.

Anyone got any ideas how to do this?

TIA
Oli

Evertjan.
11/30/2003 8:48:11 PM
Bhaskardeep Khaund wrote on 30 nov 2003 in
microsoft.public.inetserver.asp.general:
[quoted text, click to view]

Bhaskardeep, please no html on usenet !

--
Evertjan.
The Netherlands.
Bhaskardeep Khaund
12/1/2003 2:22:36 AM
Hi,

You can do this:-

<%
Dim to, from, i

to =3D Request.Form("to")
from =3D Request.Form("from")

For i =3D cInt(to) to cInt(from)
sql =3D "insert into table_name (field_name) values ("&i&")"
objConn.Execute(sql)
Next

%>

Hope this helps,

Regards,
AddThis Social Bookmark Button