Looks like you're trying to handle the ADO recordset being returned like
you would in ASP.  Note that CF really doesn't know how to handle ADO
recordsets - you'll probably want to write a wrapper object (or change
the current one) to place the recordset into an array (which I *think*
CF has no problem with) 

---
Billy Cravens


-----Original Message-----
From: David Jones [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 26, 2002 10:03 AM
To: CF-Talk
Subject: ActiveX DLL to return a collection with CFOBJECT

Hi All, I'm a new subscriber to the list and about 3 projects new to CF.
I
recently posted a message but was unsure if it got to the rest of you.
So
please paron me if you receive this as a dubplicate.

------------------------------------------------------------

I am having trouble returning a collection with the <cfobject> command.
Any
help would be appreciated.

I have an ActiveX Dll with the Prog-ID:ghZipLocator.clsghZipLocator
inside that I have a method/function called "GetCompanyNames".
GetCompanyNames returns a recordset. Which works well in ASP.


Here is my code for the "getCompanyNames" method in
Prog-ID:ghZipLocator.clsghZipLocator. You will see it is very simple.

Public Function getCompanyNames(ByVal strDsn As String, ByVal
strDsnUserid
As String, ByVal _
strDsnPasswd As String) As Variant

On Error GoTo err1


Dim connlogin As New ADODB.Connection
Dim rsResult As New ADODB.Recordset
Dim sqlCompany As String

connlogin.Open strDsn, strDsnUserid, strDsnPasswd

sqlCompany = "SELECT Company_Name, CompanyID " & _
"FROM GH_COMPANY_INFO "


Set rsResult = connlogin.Execute(sqlCompany)

Set getCompanyNames = rsResult

Exit Function
err1:

Err.Raise Err.Number, Err.Source, Err.Description
End Function



Here is my CF code.

<CFSET dsnname = "gHarvest">
<CFSET dsnuser = "sa">
<CFSET dsnpass = "">


<CFOBJECT ACTION="Create" NAME="obj"
CLASS="ghZipLocator.clsghZipLocator">

<CFSET MyRecordset=obj.GetCompanyNames(#dsnname#,#dsnuser#,#dsnpass#)>

<CFLOOP COLLECTION=#MyRecordset# ITEM=file2>
<CFOUTPUT>
#file2.Company_Name#

</CFOUTPUT>
</CFLOOP>


Everything seem to work fine until it get to the loop. At this point I
get
the following error.

unknown exception condition

unknown error while executing a tag.


I can send the VB project code if any of you think it may be helpful. If
I
am doing this incorrectly, an example of the correct procedure would be
greatly appreciated.

Thanks,

David


______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to