SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    May 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to: Classic ASP - Passing 'multiple' recordset values to another page?

    Essentially what I have to contend with in code is as follow...

    response.write objRS.Fields("TheID").value + ", "

    The above snippet populates a record set until EOF with multiple ID's comma separated (TheID, TheID, TheID...etc)

    The issues is to now pass all of these to another form in a textbox or other to later be edited.

    If any fellow coder has suggestions or bookmarked examples for this classic asp nightmare, Ideas, URLs etc... It'd be greatly appreciated. Thanks in advance.

    ** update

    Interestingly I found this article which explained my suspicion passing recordset values can't be done exclusively :

    Passing Recordset Object Between ASP Pages

    So I'm now thinking the only way is to pass it as an array

    Passing Arrays from One ASP Page to Another - 4GuysFromRolla.com

    Which works! however now the issue is to load this array into editable regions that can be updated on a SQL Server 2000 backend.

    ...any ideas?

    thanks

  2. #2
    SitePoint Addict itHighway's Avatar
    Join Date
    Jan 2008
    Location
    GUJ
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A few things, when you are saving values in the format below it is not actually saved in form of array.

    strIds = strIds & objRS.Fields("TheID").value + ", "
    You can simply pass these values to next page in QueryString like
    response.redirect("update.asp?strIds="&strIds)
    And on update page use split to separate the ids
    Split(strIds, ",")

  3. #3
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    359
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You should use the & operator to concatenate strings, not + The + operator usually works but if values can be interpreted numerically the + operator will do math in favor of concatenation.

    I always used the recordset.getrows() then saved the resulting array in a session variable to pass many recordset values between asp pages.
    Doug G
    =====
    "If you ain't the lead dog, the view is always the same - Anon


Tags for this Thread

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
  •