Storing data w/o a dB.

Results 1 to 3 of 3

Thread: Storing data w/o a dB.

  1. #1
    Steven E. Guest

    Default Storing data w/o a dB.

    *<BR>Hello all!<BR><BR>I am having a bit of an issue with the following code:<BR>(code is being wrapped due to the size of the input box)<BR><BR>&#060;%<BR><BR>Dim inpBox<BR>Dim varBodyText1<BR><BR><BR>varBodyText1 = "The following Items are being ordered from" & vbCrLf & _<BR>"the ...blah blah blah." & vbCrLf & vbCrLf<BR><BR><BR>inpBox=1<BR>ordTTl = 0<BR><BR><BR>While NOT objRec.EOF<BR><BR>strSQL = "Select * from Products Where inpBox = Counter"<BR><BR><BR>strProdAmt = objASPPlus.ASPFormat(objRec("UnitPrice"), "$#.#0")<BR>strTTL = objASPPlus.ASPFormat((objRec("UnitPrice")* Request("txt" & objRec("counter") & "")), "$#.#0") <BR><BR><BR>If Request("txt" & objRec("counter") & "") &#062; "0" then<BR>ordTTl = ordTTl + (objRec("UnitPrice")* Request("txt" & objRec("counter") & ""))<BR><BR>Response.write "&#060;tr&#062;"<BR>Response.write "&#060;td width=73 bgcolor=#FFFFFF&#062;&#060;font face=Arial size=2&#062;&#060;strong&#062;&#060;font color=#000080&#062;&nbsp;&nbsp;" & Request("txt" & objRec("counter") & "") & "&#060;/font&#062;&#060;/strong&#062;&#060;/font&#062;&#060;/td&#062;"<BR>Response.write "&#060;td width=467 bgcolor=#FFFFFF&#062;&#060;font face=Arial size=2&#062;&#060;strong&#062;&#060;font color=#000080&#062;" & objRec("ProductName") & "&#060;/font&#062;&#060;/strong&#062;&#060;/font&#062;&#060;/td&#062;"<BR>Response.write "&#060;td width=170 bgcolor=#FFFFFF&#062;&#060;p align=center&#062;&#060;font face=Arial size=2&#062;&#060;strong&#062;&#060;font color=#000080&#062;" & strProdAmt & "&#060;/font&#062;&#060;/strong&#062;&#060;/font&#062;&#060;/td&#062;"<BR>Response.write "&#060;td width=170 bgcolor=#FFFFFF&#062;&#060;p align=center&#062;&#060;font face=Arial size=2&#062;&#060;strong&#062;&#060;font color=#000080&#062;" & strTTL & "&#060;/font&#062;&#060;/strong&#062;&#060;/font&#062;&#060;/td&#062;"<BR>Response.write "&#060;/tr&#062;"<BR><BR>InpBox = inpBox + 1<BR><BR><BR><BR>Response.write varBodyText <BR><BR>End If<BR><BR><BR><BR>objRec.movenext<BR><BR>Wend<BR>< BR>%&#062;<BR><BR>Here is what I am trying to do.<BR><BR>As the above code "Loops" thru the "requested" data, I would like to have a variable accumulate the information.<BR><BR>On the first loop it stores data into a variable (this, I can do.) then on the next loop it appends the new information to the data stored in the variable on loop one. etc.etc.etc.<BR><BR>When the EOF is reached my variable now has all of the data I need for my next page.<BR><BR>I have read the Wrox books as suggested by other sites and am still confused.<BR><BR>Please, can anyone help me?!?<BR><BR>Thanks in advance to all who read!<BR><BR>Steven E. <BR>

  2. #2
    Ian Stallings Guest

    Default RE: Storing data w/o a dB.

    If you want to append it to the variable as it loops you<BR>would use this (say varBodyText is the variable):<BR><BR>varBodyText = varBodyText & "&#060;tr&#062;&#060;td&#062;" & data & "&#060;/td&#062;&#060;/tr&#062;"<BR><BR> as you loop through the code you can use the & to append<BR>data to the variable then do whatever you want with it.<BR>If you wanted to pass the info to the page you could then<BR>just use: <BR>response.write(varBodyText)<BR><BR>after EOF is reached.<BR><BR>I hope this is clear enough. If you still need help<BR>feel free ask.<BR><BR><BR>e

  3. #3
    Steven E. Guest

    Default RE: Storing data w/o a dB.

    Ian,<BR><BR>Forgive me, I am new to the ASP arena! <BR><BR>I am still unclear as to how this works. I tried your suggestion and all I get is the information from the last loop but it is shown twice.<BR><BR>I need all of the data from the loop shown only once within the variable.<BR><BR>thanks for your suggestion! Any others?

Posting Permissions

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