Forums

ASP

This topic is locked

FOR EACH NEXT from RecordSet

Posted 20 May 2005 13:06:58
1
has voted
20 May 2005 13:06:58 Rene Bandsma posted:
I have a database table that contains links to images e.g. 'image001.jpg'. I want to use all the images in the RecordSet in the Flash Image Viewer that needs the following format:

'image1.jpg', 'image2.jpg', 'image3.jpg'

I want to read out all the fields with FOR EACHT NEXT to generate a complete string out of my RecordSet...

Any help wil be appriciated!!! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

<hr><b>DMXZone support manager</b><br><a href="www.kousman.nl">Kousman web resellers</a>

Replies

Replied 20 May 2005 15:42:38
20 May 2005 15:42:38 Lee Diggins replied:
&lt;%
Dim strFlash

While ((NOT rsImages.BOF) AND (NOT rsImages.EOF))

strFlash = strFlash & "'" & (rsImages.Fields.Item("col_image_name".Value) & "'"

rsImages.MoveNext()

Wend

strFlash = Replace(strFlash,"''","', '"

Response.Write(strFlash)
%&gt;

Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
Replied 20 May 2005 15:50:12
20 May 2005 15:50:12 Rene Bandsma replied:
Yoo Lee!! Hahahaha, this is great... just posting a whole code <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle><img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>!!!

I red your topic just a few seconds to late. I have got this code:
<pre id=code><font face=courier size=2 id=code>
&lt;%
DIM mijnLijst, mijnAbeelding
Do UNTIL RecordSet1.eof
mijnAfbeelding=RecordSet1("afbeelding"
mijnLijst = mijnLijst + "'" & mijnAfbeelding & "'" & ", "
RecordSet1.movenext
LOOP
%&gt;
</font id=code></pre id=code>

Really THANKS for you posting!

&lt;hr&gt;<b>DMXZone support manager</b><br>&lt;a href="www.kousman.nl"&gt;Kousman web resellers&lt;/a&gt;

Edited by - bandsma on 21 May 2005 01:17:14
Replied 20 May 2005 17:29:21
20 May 2005 17:29:21 Lee Diggins replied:
No problemo!

You code will leave a comma at the end mine won't <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>, don't if it causes you an issue.

Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>

Reply to this topic