# of columns in rs

Results 1 to 2 of 2

Thread: # of columns in rs

  1. #1
    Join Date
    Dec 1969

    Default # of columns in rs

    I am creating an interface in my ASP that allows users to enter raw SQL (only admins can do this...). Anyway, I am trying to display the resulting rs (if it exists). Since the SQL query can return a different number of "columns" in each record in the rs, how can I find out how many columns are in each record? <BR><BR>If my rs were a regular array, Ubound(rs, 1) would work. Of course, it won&#039t.<BR><BR>Thanks.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: # of columns in rs

    rs.Fields.Count will return what you want.<BR><BR>Another way is to use the getrows function to convert the result set to an array in which case the ubound function will work.<BR><BR>somearray=rs.getrows()<BR>r = uBound(somearray) &#039 # of columns in the result set. <BR>x = uBound(somearray,2) &#039 # of rows returned from the query. <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts