Thanks, I was actually wondering that same thing. I was just about to try
doing that. Changing the object to return an array I mean. Also I was
wondering if anyone had an example of a component that does something
similar to what I am trying to do. I don't want an proprietary information
or anything. I just want to look at which references are assigned and how
the methods and properties are laid out. Basically I want to see a component
that for sure works with CF so that I can be sure of why mine do not.

Thanks,

Dave



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


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



______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.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