1 Reply Latest reply on Jul 5, 2007 6:06 PM by c_wigginton

    COM object problem

    redeftboy_original
      I am attempting to rewrite some ASP code with CF MX 7. The ASP code originally returned a recordset from Microsoft Indexing Service. I can create the object and return the number of objects within the recordset but I don't know how to access the records within the recordset (i.e. output the records).

      I've tried the code below to loop over the collection without any success as I receive the error: " The cause of this exception was that: java.lang.NoSuchMethodException: There is no method called Item."

      Any help would be appreciated.

      <cfobject action="create" type="com" name="q" class="ixsso.query">
      <cfset q.query(#searchstring#)>
      <cfset q.catalog(#catalogtosearch#)>
      <cfset q.sortby(#searchrankorder#)>
      <cfset q.columns("doctitle, filename, size, write, rank, directory, path")>
      <cfset q.maxrecords(#maxrecords#)>

      <cfset rs = q.createrecordset("nonsequential")>

      <cfoutput>
      This object has #rs.recordcount# items.
      <BR>
      <HR>
      </cfoutput>

      <cfloop collection = "#rs#" item = "file2">
      <cfoutput>
      Path: #file2.path# <BR>
      </cfoutput>
      </cfloop>