• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

COM object problem

New Here ,
Jul 05, 2007 Jul 05, 2007

Copy link to clipboard

Copied

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>
TOPICS
Advanced techniques

Views

222

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 05, 2007 Jul 05, 2007

Copy link to clipboard

Copied

LATEST
You have to iterate over the recordset with the MoveNext() method.

Here's an Adobe KB article on the subject

http://www.adobe.com/devnet/coldfusion/articles/asp_cfmx.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation