Ask a Question related to ASP Database, Design and Development.
-
Oli #1
Listing all number between 2 points
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 access database over 10 rows
into the 'number' field.
Anyone got any ideas how to do this?
TIA
Oli
Oli Guest
-
File Listing
Hi there. First of all, sorry for my poor english. I have a problem that I don't know how to resolve. I want to make a dynamic image gallery.... -
Listing Datasources in MX 6.1
Anyone know what's up with CFMX 7 and doing this same thing? It's clearly been ripped out and re-done with the new funtionality in the api's...... -
int Number to text Number Function / UDF ?
Is there a function that converts e.g. 3 to Three? Probably not but I just thought I'd ask. -
Listing
Hello, I am just working on a text where I need to use listing symbols like in MS Word (dash oder points). But I cannot find anything like that in... -
sort from the smallest number to the highest number
Hi Just say I want to sort the row by using the fifth column data as reference from the smallest the largest number, if using sort, It will give... -
Aaron Bertrand [MVP] #2
Re: Listing all number between 2 points
Once you submit the form, I suppose you could do this:
<%
' assuming a valid connection object 'conn'
Nfrom = request.form("from")
Nto = request.form("to")
' I'll assume checks for isnumeric and
' valid range, e.g. from <= to
for i = Nfrom to Nto
conn.execute("INSERT tbl(number) VALUES(" & i & ")")
next
%>
But, why do you have to *store* the range? Couldn't you produce the numbers
between the two points at SELECT time? E.g. using the same kind of looping
logic above. There is no reason to store the entire range across 10 rows
when there is a consecutive sequence... this just seems wasteful to me.
In SQL Server you could use a numbers table, and just store the beginning
and end. You could join on the numbers table so that you don't have to
store the range.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
"Oli" <oli@NOSPAMoliwoods.co.uk> wrote in message
news:bqdbdm$5hm$1@hercules.btinternet.com...return> Hi
>
> I have 2 textboxes - from & to.
> Assume I enter number 1 in "from" and "10" in to - I want the ASP to> : 1,2,3,4,5,6,7,8,9,10 and insert this into access database over 10 rows
> into the 'number' field.
>
> Anyone got any ideas how to do this?
>
> TIA
> Oli
>
>
Aaron Bertrand [MVP] Guest



Reply With Quote

