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
Thanks in advance
Same way you would pass anyting to a dll... but use Request.Form as the variable
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
ASKER
Hi, experts!
What's wrong in my code?
ASP code:
dim ReqForm
set ReqForm=Request.Form
NewBoard = Product.CreateNewBoard(Req
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(Req uest.Form)
Keep in mind that the Request.Form is an array...if that matters.
NewBoard = Product.CreateNewBoard(Req
Keep in mind that the Request.Form is an array...if that matters.
ASKER
i've tryed that: NewBoard = Product.CreateNewBoard(Req uest.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 ?
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....
Private Sub SetFormData(FormData)
dim colFD
colFD = FormData
End Sub
Or something like that....
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
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
Could try:
for each i in colFD
response.write i
next
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?
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)
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)
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) ???
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
ASKER
alorentz, thank you for help
Good luck...