Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Convert simple asp form to a vb6 form

Posted on 2006-03-22
12
Medium Priority
?
259 Views
Last Modified: 2010-05-01
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
0
Comment
Question by:Jimmyx1000
  • 4
  • 3
  • 2
9 Comments
 
LVL 3

Expert Comment

by:ptan218
ID: 16264850
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
 

Author Comment

by:Jimmyx1000
ID: 16266133
can you give the full vb6 code please


thankyou experts
0
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 2000 total points
ID: 16266424
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Expert Comment

by:ptan218
ID: 16267045
Check out the code that zzzzooc has given. He has provided what I meant...
0
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 16268288
>>He has provided what I meant
What did you mean?
0
 

Author Comment

by:Jimmyx1000
ID: 16271629
can you please test this , to see if it works

thankyou experts
0
 

Author Comment

by:Jimmyx1000
ID: 16271762
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
 
LVL 3

Expert Comment

by:ptan218
ID: 16278133
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
 

Author Comment

by:Jimmyx1000
ID: 16289705
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

580 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