Loading an array into a session variable and then

Results 1 to 3 of 3

Thread: Loading an array into a session variable and then

  1. #1
    Alex E Guest

    Default Loading an array into a session variable and then

    Could anyone help me. I am developing an application for my company&#039s intranet. One part of it has to do with scheduling meetings. I want to be able to allow the user to search the contacts database and pull out persons to include as invitees to the meeting.<BR><BR>I created a button called lookup on the add schedule item page. by pressing this button a javascript new window open function is called. After it opens it presents a search form that has criteria filtering text fields. After submitting the request is processed and displayed with a checkbox field by each entry. The number of records have been limited to 10 by the TOP statement, so there are on 10 records displayed (So I can control how many I am looking for in the next page) After the user makes his/her selection and presses submit. The request is processed by:<BR><BR>Dim x(10,2)<BR>x(1,1) = Request("C1")<BR>X(1,2) = Request("R1")<BR>Session("invitees") = x<BR><BR>C1 is the on or off property of the check box<BR>R1 is the record number of the contact<BR><BR>After loading into the array and into the session variable. I tell the user to close the window via a javascript button and to refresh the add schedule item screen.<BR><BR>On the Add screen I declared <BR><BR>x = Session("Invitees") <BR><BR>If x(1,1) &#060;&#062; "" Then<BR>RecX = x(1,2)<BR>End If <BR><BR>In the text fields I wanted that information to be presented I had.<BR><BR>&#060;%= RecX %&#062;<BR><BR>For all ten of them. When I went to test the page it gave me an error. Type mismatch. What am I doing wrong?<BR><BR>Alex

  2. #2
    Cyanide_7 Guest

    Default RE: Loading an array into a session variable and t

    You may have to provide more code. What you have seems sound enough. - Cyanide_7

  3. #3
    Alex E Guest

    Default RE: Loading an array into a session variable and t

    Okay here is some code. I omitted all 10 of the variables because they are identical<BR><BR>On the page calling the records:<BR><BR>A = Request.Form("LastName") & "%"<BR>**** Note I have more criteria but to much to display here***<BR>connection string<BR>Set add = conn.execute("Select Top 10 * from Table Where LastName Like " & "&#039" & A & "&#039")<BR><BR>Response.Write "&#060;form method=&#039post&#039 action=&#039addfindresults.asp&#039&#062;"<BR>Do Until Add.Eof<BR>Z = Z + 1<BR>Response.Write Z & "&nbsp;"<BR>Response.Write Add("FirstName") & "&nbsp;" & Add("LastName")<BR>Response.Write "&nbsp;&#060;input type=&#039checkbox&#039 name=&#039C" & Z & "&#039 value=&#039inc&#039&#062;"<BR>Response.Write "&#060;input type=&#039hidden&#039 name=&#039Rec" & Z & "&#039 value=&#039" & Add("AutoNumber") & "&#039&#062;"<BR>Add.MoveNext<BR>Loop<BR><BR>* ** I close the connection and then the user submits the form with the items checked that they would like.<BR><BR>On the add to list page:<BR><BR>Dim x(10,2)<BR>x(1,1) = Request("C1")<BR>x(1,2) = Request("Rec1")<BR>Session("Invitees") = x<BR>Response.Write "JavaScript enabled close window button here"<BR><BR>*** Inform the user that the display must be updated on the add meeting invitees page. They close the window<BR><BR>On the Add Meeting page:<BR><BR>Open connection to the database.<BR>Set Record = conn.execute("Select * From Table")<BR>x = Session("Invitees")<BR><BR>If x(1,1) &#060;&#062; "" Then<BR>Record.Filter = "AutoNumber=&#039" & x(1,2) & "&#039"<BR>Rec1 = Record("FirstName") & "&nbsp;" & Record("LastName")<BR>End If<BR><BR>I then loop through all 10 in order to see if values for x(array)<BR>exist for all ten items. The results populate the text box field.<BR><BR>

Posting Permissions

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