Results 1 to 3 of 3

Thread: John

  1. #1
    ASP error w/memo fields? Guest

    Default John

    Hi, I have found that I can only output the value of a memo field within a recordset once. For example, if oRS is a recordset object:<BR><BR>-------------------------------------<BR>Do While Not oRS.EOF<BR><BR>For i = 1 to 5<BR>Response.write(oRS.Fields("mymemo"))<BR>Next< BR><BR>oRS.MoveNext<BR>Loop<BR>-------------------------------------<BR><BR>The value of "mymemo" is only displayed once. Is this a bug? This only happens if the field type is memo - if I change it to text, the value is correctly displayed 5 times. Also, I am using PWS - does PWS have known bugs like this? For a workaround, I had to store the memo field in a variable first.<BR><BR>Thanks in advance for any feedback.

  2. #2
    Join Date
    Dec 1969

    Default RE: John

    Which is what you should do if you are going to be using the same value more than once, as this is good coding practice.<BR><BR>Something like...<BR><BR>Set strVariable = rst("memofield")<BR><BR><BR>HTH<BR><BR>Jerry

  3. #3
    SPG Guest

    Default Actually, the workaround is right...

    Well, I don&#039t know about it being a bug of any specific sort (it looks that way, but I&#039ve never used PWS). The funny thing is that -- according to people who&#039ve clocked it (Microsoft included):<BR><BR>When you&#039re using an object property repeatedly, it is faster to copy it to a local variable [your workaround] and read it from there than it is to read it from the object repeatedly.<BR><BR>(You can probably find that in the Microsoft 25+ Style & Perf. Tips & Tricks, as well as Microsoft&#039s IIS Tuning page.)<BR><BR>Cheers!

Posting Permissions

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