Convert simple asp form to a vb6 form

Id like to use an exe to send data to an asp page

how can i convert the following to vb6

<form method="POST" action="recieve.asp">
Name <input type="text" name="Name"/>
Age <input type="text" name="Age"/>
<input type="submit" />
</form>


thanks experts
Jimmyx1000Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ptan218Commented:
I believe you can use the Internet Transfer Control component.

Then you can just form the URL as "http:/xxxxxxx.com/receive.asp?name=xxxx" etc and call the inet.OpenURL and passing the URL string.
0
Jimmyx1000Author Commented:
can you give the full vb6 code please


thankyou experts
0
zzzzzoocCommented:
Maybe something like the below.

I haven't actually tested it (no server-side script) but it should work. It may require slight modifications if not. Also, you may need to "escape" the characters for pData (such as changing " " into %20 (hex for a space).

Form1:
---------------------
Option Explicit
Private Sub Form_Load()
    '
End Sub
Private Sub Command1_Click()
    Call FormSubmit("http://www.google.com/response.asp", "the_name", "the_age")
End Sub
Private Sub FormSubmit(ByVal sPath As String, ByVal sName As String, ByVal sAge As String)
    Dim pHdr As String
    Dim pData As String
    pHdr = "Content-Type: application/x-www-form-urlencoded" & vbCrLf & vbCrLf
    pData = "Name=" & sName & "&Age=" & sAge
    If (Inet1.StillExecuting = True) Then
        Inet1.Cancel
    End If
    Call Inet1.Execute(sPath, "POST", pData, pHdr)
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ptan218Commented:
Check out the code that zzzzooc has given. He has provided what I meant...
0
zzzzzoocCommented:
>>He has provided what I meant
What did you mean?
0
Jimmyx1000Author Commented:
can you please test this , to see if it works

thankyou experts
0
Jimmyx1000Author Commented:
seems to be an error

compile error ,
variable not defined

on line
If (Inet1.StillExecuting = True) Then

which controls do i need to add also

thanks experts
0
ptan218Commented:
1. Go to Project | Component
2. Look for Internet Transfer Control component.
3. Add it into your project.
4. Pick the component from the toolbox and add to your form.
0
Jimmyx1000Author Commented:
How can i get some sort of response returned when the command button is clicked
i.e post info recieved ok

here is my asp recieve page


<%
Dim name, age
name = Request.Form("Name")
age = Request.Form("Age")
Response.Write("Name: " & name & "<br />")
Response.Write("Age: " & age & "<br />")
%>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.