SQL Question

Got a quick SQL/MySQL question for you.
We don’t have a database question @ Kirupa so I thought server side would be best.

Anyway when your looking for a recordset (ASP) you get the SQL statement

SELECT * FROM Events

Run it and then go through the recordset like

RecordSet.MoveFirst
while not end of recordset
[INDENT]response.write recordset.fields(“customerid”).item[/INDENT]
[INDENT]recordset.movenext[/INDENT]
wend

but does anybody know what to do if you don’t know the columns (for instance if the SQL script is fed in with a parameter so the columns will be different every time.

Any help’s great (either tips or direct me to a good site)
thanks :thumb:

If recordest.fields is an associative array, surely there’s some way to loop over it? I don’t know VB, so there’s not much I can do to help really :frowning:

Also, just a pointer: afaik it’s good form to put column names and table names into all lowercase :slight_smile:

field object

here’s a link with some example code:

http://p2p.wrox.com/topic.asp?TOPIC_ID=6751

thanks prstudio, that worked a treat :thumb:

np bud