Professional Web Applications Themes

asp solution? - ASP

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 ...

  1. #1

    Default Re: asp solution?

    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 (p) 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 [url]www.able-consulting.com/ado_conn.htm[/url] - 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


    Bob Barrows Guest

  2. #2

    Default asp solution?

    This should get you fixed up...
    [url]http://www.aspfaq.com/show.asp?id=2257[/url]


    Bob Lehmann Guest

  3. #3

    Default Re: asp solution?

    "Need_help" wrote:
    >
    > 1. SELECT VALUES FROM TABLE A WHERE ID=5
    [snip]

    [url]http://www.aspfaq.com/5005[/url]


    --
    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.


    Dave Anderson Guest

  4. #4

    Default Re: asp solution?

    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" <nospamnospam.hr> wrote in message
    news:uwHVxWfdDHA.1712tk2msftngp13.phx.gbl...
    > 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 (p) this
    > values in single variable, so I can send this values to pageB.asp
    >
    >

    only_me Guest

  5. #5

    Default asp solution?

    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 (p) this
    values in single variable, so I can send this values to pageB.asp


    Need_help Guest

Similar Threads

  1. i need solution
    By sathish in forum ASP.NET Web Services
    Replies: 1
    Last Post: May 25th, 07:29 AM
  2. Do you have a solution for this please?
    By raladin in forum Macromedia Director Basics
    Replies: 1
    Last Post: February 18th, 01:19 PM
  3. WHAT'S THE BEST SOLUTION
    By nightclubfusion webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 1
    Last Post: September 18th, 12:50 PM
  4. A Non ASP Guy Needs Help with a Solution
    By ratlhead in forum ASP
    Replies: 2
    Last Post: September 1st, 12:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139