View Single Post
 
Old May 9th, 2013, 10:22 PM
mat41 mat41 is offline
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default Detect if a names field exists in a record set

Hello classic ASP world, hopefully there are still a few of us around...

Does anybody know how to check if a named field is within a record set?

EG id, field1, field2, field3 have been selected. Is it possible for VBScript to detect if field2 has been selected..

Please assume I dont know, nor can see the actual SELECT. I need to detect this after the query has been executed.

How to do it while looping, BUT I am also hoping this is possible without looping

Code:
    sql = "SELECT * from tableName;"
    set rs = conn.execute(sql)
    For Each field in rs.Fields
      if field.Name = "lookinForFieldName" then foundField = true else foundField = false
    next
TYIA
__________________
Wind is your friend
Matt

Last edited by mat41; May 9th, 2013 at 10:36 PM..