Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > asp solution?

Reply
Thread Tools

asp solution?

 
 
Bob Barrows
Guest
Posts: n/a
 
      09-08-2003
Need_help wrote:
> 1. SELECT VALUES FROM TABLE A WHERE ID=5
>
> 2. I create an array x(0,n), and I populate n with the values based on
> select above.
>
> What I have... I have x(0,1)
> x(0,2)
> x(0,3)... and so on.
>
> Result:> I need to have variable called
> varx that should consist all the values from x(0,1), x(0,2), x(0,n).
>
> So I need to declare varx = x(0,1) & "," & x(0,2) & etc.
>
> 1. question. I don't know how many elements I would have, coz they
> depends on "select".
> 2. Can someone give me example how I can dynamicly create (parse) this
> values in single variable, so I can send this values to pageB.asp


This demonstrates using GetRows to create your array and also shows how to
process the resulting array. For more detail, see ADO online help at
msdn.microsoft.com.

dim cn,sConnect,sSQL,rs,ar, iRow, iCol
sSQL = "SELECT VALUES FROM TABLE A WHERE ID=5"

'for debugging purposes:
response.write sSQL
'you can get rid of this line when debugging is complete

sConnect = "<valid connection string>"
' - see www.able-consulting.com/ado_conn.htm - concentrate on the
'OLEDB connection examples for your database
set cn=server.createobject("adodb.connection")

cn.open sConnect
set rs=cn.execute(sSQL,,1)
if not rs.eof then ar=rs.getrows
rs.close
set rs=nothing
cn.close
set cn=nothing
if isarray(ar) then
for iRow=0 to ubound(ar,2)
for iCol = 0 to ubound(ar,1)
response.write ar(iCol,iRow) & "; "
next
response.write "<br>"
next
else
response.write "no records were returned"
end if

HTH,
Bob Barrows


 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      09-08-2003
"Need_help" wrote:
>
> 1. SELECT VALUES FROM TABLE A WHERE ID=5


[snip]

http://www.aspfaq.com/5005


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.


 
Reply With Quote
 
 
 
 
only_me
Guest
Posts: n/a
 
      09-16-2003
Try the "join" function
Description
Returns a string created by joining a number of substrings contained in an
array.
Syntax
Join(list[, delimiter])
The Join function syntax has these parts:



"Need_help" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 1. SELECT VALUES FROM TABLE A WHERE ID=5
>
> 2. I create an array x(0,n), and I populate n with the values based on
> select above.
>
> What I have... I have x(0,1)
> x(0,2)
> x(0,3)... and so on.
>
> Result:> I need to have variable called
> varx that should consist all the values from x(0,1), x(0,2), x(0,n).
>
> So I need to declare varx = x(0,1) & "," & x(0,2) & etc.
>
> 1. question. I don't know how many elements I would have, coz they depends
> on "select".
> 2. Can someone give me example how I can dynamicly create (parse) this
> values in single variable, so I can send this values to pageB.asp
>
>



 
Reply With Quote
 
Need_help
Guest
Posts: n/a
 
      10-24-2003
1. SELECT VALUES FROM TABLE A WHERE ID=5

2. I create an array x(0,n), and I populate n with the values based on
select above.

What I have... I have x(0,1)
x(0,2)
x(0,3)... and so on.

Result:> I need to have variable called
varx that should consist all the values from x(0,1), x(0,2), x(0,n).

So I need to declare varx = x(0,1) & "," & x(0,2) & etc.

1. question. I don't know how many elements I would have, coz they depends
on "select".
2. Can someone give me example how I can dynamicly create (parse) this
values in single variable, so I can send this values to pageB.asp


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
global filter to redirect asp (old asp!) pages on asp.net site Daves ASP .Net 2 05-31-2006 08:33 AM
2.0: asp:Menu, asp:XmlDataSource, asp:PlaceHolder R.A.M. ASP .Net 1 03-29-2006 07:55 AM
[ASP.NET1.1]Should I kill the ASP.NET worker process after recompilingmy ASP.NET webservice? Andrea Raimondi ASP .Net 1 02-06-2006 08:10 AM
ASP.Net cookie -> ASP -> ASP.Net Ben ASP .Net 3 05-28-2004 03:35 PM
LOOP through an ASP form's pages (not ASP.NET - ASP classic) David A. Beck ASP General 10 04-13-2004 05:38 PM



Advertisments