• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

Pass a Request.Form collection to dll

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

Thanks in advance
0
mikef17
Asked:
mikef17
  • 8
  • 7
1 Solution
 
alorentzCommented:
Same way you would pass anyting to a dll... but use Request.Form as the variable
0
 
wesbirdCommented:
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
0
 
mikef17Author Commented:

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
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
alorentzCommented:
Could try:

NewBoard = Product.CreateNewBoard(Request.Form)

Keep in mind that the Request.Form is an array...if that matters.
0
 
mikef17Author Commented:
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 ?
0
 
alorentzCommented:
don't use SET:

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

Or something like that....
0
 
mikef17Author Commented:
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


0
 
alorentzCommented:
Correct, it is not an accessible coolection:

Could try:

for each i in colFD
    response.write i
next
0
 
mikef17Author Commented:
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?
0
 
alorentzCommented:
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)


0
 
mikef17Author Commented:
-------------------------------------------------------------
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) ???

0
 
alorentzCommented:
No, to access it as a array:

Private Sub SetFormData(FormData)
  dim colFD
  colFD = split(FormData, ",")  'NOW ITS AN ARRAY
End Sub
0
 
mikef17Author Commented:
So there aren't any way to sent a collection Request.Form as it ,from ASP page to dll ?
0
 
alorentzCommented:
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?
0
 
mikef17Author Commented:
alorentz, thank you for help
0
 
alorentzCommented:
Good luck...
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now