ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 26th, 2003, 09:06 PM
anax anax is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Denmark
Posts: 3 anax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 39 sec
Reputation Power: 0
Question help stepping trough a recordset

heya , im currently working with a dynamic stylesheet that gets its data from a db. it works fine , but the way im stepping trough my records and adding them to the style is a bit messy , and i need to hardcode alot.
I was wondering if there is an easier way to do it with less code , maybe some loops and arrays , currently i got like 120style options , thats a lot of code repeats

Below this is a sample of my code that i use to get the style-data out of the db.

dim hIcolor, hIIcolor, strConnect
objRS.Open "SELECT * FROM Style", strConnect
hIcolor = objRS("Data")
objRS.MoveNext
hIIcolor = objRS("Data")
objRS.MoveNext
etc
etc
etc

Reply With Quote
  #2  
Old June 27th, 2003, 02:08 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
there's a range of methods you could use. It all depends on how your data is stored and displayed.

Loops look like:
do until rs.EOF
... do stuff until the recordset ends
rs.movenext
loop

or, if you dump your RS out to an array (MUCH faster this way)
for idx = 0 to ubound(aryRS,2)
... do stuff till you hit the array ubound
next
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > help stepping trough a recordset


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway