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 ______________________________________________________________________ Get the mailserver that powers this list at http://www.coolfusion.com 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