Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: Re: Can I pass Request.Form Collection to a VB COM?


Message #1 by "Sunny Deol" <sunnydhillion@h...> on Wed, 1 Aug 2001 19:29:39
> I want to pass ASP Request.Form collection to a VB COM so I could run 

> through all the Form elements inside my COM to save the data.

> 

> I tried a peace of code like this [Call xCOM.SaveData(Request.Form)] to 

> pass the collection but COM returns an error back that object required.

> 

> Please help.....

> 

> Thanks,

> 

> Sunny

> 



Thanks allot guys for replying to my message.  The examples you guys post 

is great examples but I was actually trying to avoid the over head added 

by Microsoft Type Libararies and just get the Request.Form collection 

directly from ASP page.  I found out that inside my COM I was taking the 

Form collection ByRef.  It does not work ByRef but I had to take it as 

ByVal inside my COM.  



ASP Call:

 Call SaveData(Request.Form)



COM Code:

Public Function SaveData(ByVal vntRequest As Variant)

  Dim x_colLocal As Variant

  Set x_colLocal = vntRequest

  abc = x_colLocal("TestField")

End Function



Another thing I was doing wrong is that I was trying to assign my local 

variable abc = x_colLocal.Form("TestField").  Form doesn't need to be 

specified since the local collection was already set to FORM collection 

(vntRequest).



Hope this will help someone in the future.



Thanks allot for replying to my message again.



Sunny


  Return to Index