#1
  1. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Oct 2006
    Posts
    250
    Rep Power
    12

    ADO Fields Collection - Name and Type showing empty


    Update: Not sure exactly what was causing the problem, but when I turned on Option Explicit and resolved any issues I ended up with a working code. Since this is of little use to anyone I suggest an Admin kindly delete this post.
    Many thanks.


    Hi all

    I have a strange problem that I hope you can assist me with. I'm looping through a recordset looking at the fieldnames and types as follows:

    Code:
    		DIM fieldsCount
    		fieldsCount = rs_access.Fields.Count 
    		
    		For i_count = 0 To fieldsCount - 1
    			tempType = rs_access.Fields(i_count).Type
    			tempName = rs_access.Fields(i_count).Name
    		Next
    As a standalone .asp file this works fine, but when I attempt to use it via a server side include the Fields.Type and Fields.Name always come back as nothing. There is definitely a resultset as I can debug and see the fields count is correct, and if I add a test to the for loop to retrieve a specific field, i.e. rs_access("fieldname") I get the data displayed.

    Any ideas?

    Thanks, Stephen
    Last edited by badasafish; November 21st, 2012 at 11:09 AM. Reason: Fixed

Similar Threads

  1. Replies: 11
    Last Post: April 2nd, 2009, 08:28 AM
  2. Request.Form collection returns empty
    By Nilpo in forum ASP Development
    Replies: 13
    Last Post: January 9th, 2009, 06:01 PM
  3. Replies: 2
    Last Post: November 30th, 2005, 07:06 AM
  4. How to stop a field in a query showing if it is empty
    By cazlj in forum Microsoft Access Help
    Replies: 2
    Last Post: January 10th, 2005, 08:18 AM
  5. Replies: 2
    Last Post: September 15th, 2004, 05:32 PM

IMN logo majestic logo threadwatch logo seochat tools logo