Link to home
Start Free TrialLog in
Avatar of mikef17
mikef17

asked on

Pass a Request.Form collection to dll

How can i pass a Request.Form collection to dll function written in VB6?

Thanks in advance
Avatar of alorentz
alorentz
Flag of United States of America image

Same way you would pass anyting to a dll... but use Request.Form as the variable
Avatar of wesbird
wesbird

File->New->IIS Application to create a Webclass application.  Then just use the Request.form and Server.xxxx objects as if you are on an ASP page
Avatar of mikef17

ASKER


Hi, experts!
What's wrong in my code?

ASP code:

dim  ReqForm
set ReqForm=Request.Form
NewBoard = Product.CreateNewBoard(ReqForm)


VB code:

Private Sub SetFormData(FormData As Collection)
  dim colFD as Collection
  Set colFD = FormData
End Sub

I've used also:
Private Sub SetFormData(FormData)
  dim colFD as Collection
  Set colFD = FormData
End Sub
Could try:

NewBoard = Product.CreateNewBoard(Request.Form)

Keep in mind that the Request.Form is an array...if that matters.
Avatar of mikef17

ASKER

i've tryed that: NewBoard = Product.CreateNewBoard(Request.Form)  before.

When i try that:

Private Sub SetFormData(FormData)
  dim colFD as Collection
  Set colFD = FormData
End Sub

a problem is a Type mismatch in VB in:  Set colFD = FormData, because FormData  Is Array?!

So what can i do ?
don't use SET:

Private Sub SetFormData(FormData)
  dim colFD
  colFD = FormData
End Sub

Or something like that....
Avatar of mikef17

ASKER

in my code colFD  is a global variable.

in other function i try to use:

dim Temp as String
Temp = colFD ("myKey") - here i get a Type mismatch Error

i think that because colFD is not Collection


Correct, it is not an accessible coolection:

Could try:

for each i in colFD
    response.write i
next
Avatar of mikef17

ASKER

May be i not so clear :

now there aren't problem with colFD = FormData, but when i try work with colFD
Temp = colFD ("myKey") i get a Type mismatch Error

Do you have any idea?
OR:


ASP code:

for each i in request.form
   a = a + i & ","  'CREATE DELIMITED STRING OF FORM VALUES
next
if len(a) > 0 then
   a = left(a, len(a)-1)
end if

NewBoard = Product.CreateNewBoard(a)


VB code:

Private Sub SetFormData(FormData)
  dim colFD
  colFD = FormData  'NOW ITS A DELIMITED STRING
End Sub

dim Temp as String
Temp = colFD (myKey)


Avatar of mikef17

ASKER

-------------------------------------------------------------
colFD = FormData  'NOW ITS A DELIMITED STRING

dim Temp as String
Temp = colFD (myKey)
-------------------------------------------------------------
So can i use a  delimited string as collection?  Temp = colFD (myKey) ???

ASKER CERTIFIED SOLUTION
Avatar of alorentz
alorentz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mikef17

ASKER

So there aren't any way to sent a collection Request.Form as it ,from ASP page to dll ?
Doesn't appear so, you've tried how it SHOULD be done.  May be a problem because a Request object in ASP is not interpretted as on object in VB?
Avatar of mikef17

ASKER

alorentz, thank you for help
Good luck...