470,618 Members | 1,887 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,618 developers. It's quick & easy.

Listing Numbers

Oli
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
Jul 19 '05 #1
3 1310
Please don't multi-post. I answered this in another group...

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


"Oli" <ol*@NOSPAMoliwoods.co.uk> wrote in message
news:bq**********@titan.btinternet.com...
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

Jul 19 '05 #2
Hi,

You can do this:-

<%
Dim to, from, i

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

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

%>

Hope this helps,

Regards,
Bhaskardeep Khaund
Jul 19 '05 #3
Bhaskardeep Khaund wrote on 30 nov 2003 in
microsoft.public.inetserver.asp.general:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.94" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>


Bhaskardeep, please no html on usenet !

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Chris | last post: by
1 post views Thread by httpmart | last post: by
19 posts views Thread by SU News Server | last post: by
3 posts views Thread by David Jacques | last post: by
12 posts views Thread by soccertl | last post: by
1 post views Thread by Johnny Jörgensen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.