|
| |
|
|
ACEDISH
Posts: 176 Joined: 9/30/2002 From: Manassas, Virginia Status: offline
|
increment varible name in database query - 11/21/2006 16:33:32
Hello, I want to increment the varible name by 1 when looping through Record Setsbut I am having some difficulty. I tried the following with no luck. Do until RS1.EOF c=c+1 pic(c)&1=RS1("filename") picdesc(c)=RS1("picdesc") picdate(c)=RS1("uploaddate") END IF RS1.MoveNext
_____________________________
" Anyone who can only think of one way to spell a word obviously lacks imagination"
|
|
|
|
ACEDISH
Posts: 176 Joined: 9/30/2002 From: Manassas, Virginia Status: offline
|
RE: increment varible name in database query - 11/21/2006 19:59:42
This isn't pretty but it is working, basically I am displaying the last 4 thumbnails in a photo page. the pictures are in various locations in the page so I was defining which pictures and details that would be displayed. Set DB1 = Server.CreateObject("ADODB.Connection") DB1.Open Application("membersDB_ConnectionString") Set RS1 = DB1.Execute ("SELECT * FROM pic WHERE (siteID = '1' AND ID > '"& startID & "') ORDER BY ID DESC") Do until RS1.EOF c=c+1 IF c = 1 THEN pic1 =RS1("filename") picdesc1=left(RS1("picdesc"),80) picdate1=RS1("uploaddate") END IF IF c = 2 THEN pic2 =RS1("filename") picdesc2=left(RS1("picdesc"),80) picdate2=RS1("uploaddate") END IF IF c = 3 THEN pic3 =RS1("filename") picdesc3=left(RS1("picdesc"),80) picdate3=RS1("uploaddate") END IF IF c = 4 THEN pic4 =RS1("filename") picdesc4=left(RS1("picdesc"),80) picdate4=RS1("uploaddate") END IF RS1.MoveNext Loop
_____________________________
" Anyone who can only think of one way to spell a word obviously lacks imagination"
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|