Information générale
Catégorie:
COM/DCOM et OLE Automation
As far as I know you can't return a VFP collection class from a com object and use it in ASP. Try returning an ado recordset or an xml string.
>I've created a Multi-Threaded DLL out of the below and installed it in Component Services.
>If I create the object from an ASP page with VBScript, it runs fine the first 7 or 8 times.
>Then it consistently returns an error.
>Help. Is there any reason you can't return a collection and access it from VBScript in the ASP page?
>Is there anything special I should be doing in the ASP page?
>
>
>DEFINE CLASS Location AS Session OLEPUBLIC
> NAME = 'Location'
> cDataPath = "G:\xxx\data\"
>
> FUNCTION INIT
> SET TALK OFF
> SET RESOURCE OFF
> SET CPDIALOG OFF
> SET DELETED ON
> SET EXACT OFF
> SET SAFETY OFF
> SET EXCLUSIVE OFF
> SET REPROCESS TO 2 SECONDS
> SYS(2335,0)
> RETURN
> ENDFUNC
>
> FUNCTION GetLocationList as Object
> LOCAL loTable AS COLLECTION, loRecord AS OBJECT
> loTable = CREATEOBJECT("Collection")
> SELECT Loc_PK, Loc_Name from (this.cdatapath + "LOCATION") into cursor curTEMP
> SCAN
> SCATTER NAME loRecord
> loTable.ADD(loRecord)
> ENDSCAN
> RETURN loTable
> ENDFUNC
>ENDDEFINE
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement