Solved

Pass a Request.Form collection to dll

Posted on 2004-09-23
16
396 Views
Last Modified: 2006-11-17
How can i pass a Request.Form collection to dll function written in VB6?

Thanks in advance
0
Comment
Question by:mikef17
  • 8
  • 7
16 Comments
 
LVL 31

Expert Comment

by:alorentz
ID: 12132157
Same way you would pass anyting to a dll... but use Request.Form as the variable
0
 
LVL 7

Expert Comment

by:wesbird
ID: 12132190
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
 

Author Comment

by:mikef17
ID: 12132972

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
 
LVL 31

Expert Comment

by:alorentz
ID: 12133005
Could try:

NewBoard = Product.CreateNewBoard(Request.Form)

Keep in mind that the Request.Form is an array...if that matters.
0
 

Author Comment

by:mikef17
ID: 12133078
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
 
LVL 31

Expert Comment

by:alorentz
ID: 12133132
don't use SET:

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

Or something like that....
0
 

Author Comment

by:mikef17
ID: 12133740
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
 
LVL 31

Expert Comment

by:alorentz
ID: 12133951
Correct, it is not an accessible coolection:

Could try:

for each i in colFD
    response.write i
next
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:mikef17
ID: 12133958
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
 
LVL 31

Expert Comment

by:alorentz
ID: 12133985
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
 

Author Comment

by:mikef17
ID: 12134282
-------------------------------------------------------------
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
 
LVL 31

Accepted Solution

by:
alorentz earned 125 total points
ID: 12134429
No, to access it as a array:

Private Sub SetFormData(FormData)
  dim colFD
  colFD = split(FormData, ",")  'NOW ITS AN ARRAY
End Sub
0
 

Author Comment

by:mikef17
ID: 12134697
So there aren't any way to sent a collection Request.Form as it ,from ASP page to dll ?
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12134782
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
 

Author Comment

by:mikef17
ID: 12134948
alorentz, thank you for help
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12134961
Good luck...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
pass url parameter as session 9 48
Age between date range query (SP) 13 52
Live mode in DW, need to creae Session 4 78
HTML in email body has extra  tick marks 3 64
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now