Listing Numbers

O

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
 
E

Evertjan.

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 !
 
B

Bhaskardeep Khaund

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,816
Members
47,362
Latest member
ayamcy

Latest Threads

Top