|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Working code to pass values from vb6 to asp
am now doing a assignment that vb6 pass value to asp, and asp return the value back to vb6. I had done the first step to connect to vb6 to asp, but the 2nd step i am stuck. I tried many ways to connect but still unable to do it. My teachers and fellow friends all had no idea to help me. I am surprised even teachers told me they don't know or they don't want to help me.
Teachers that told me the method are not click with my assignment criteria. Anyone or professional who knows it, please teach me or give me some samples coding please. I really need help. asp return values to vb6 is automatically not manually. After i pass a value from vb6 to asp, asp will return it automatically. This is my vb6 code passing value to asp Code:
Private Function btnCheck_onclick() As Boolean
Dim UserID As String
Dim HostID As String
Dim url As String
Dim strUserID As String
Dim strHostID As String
strUserID = UserIDtxt.Value
strHostID = HostIDtxt.Value
url = "http://172.20.129.61/a.asp?User=" & strUserID & " Host Id is " & strHostID & ""
Dim Success As Long
Success = ShellExecute(0&, vbNullString, url, vbNullString, "C:\", SW_SHOWNORMAL)
End Function
This is my asp code
<%@ Language=VBScript%>
<%Option Explicit%>
<HTML>
<HEAD>
<TITLE>Booking PC Status</TITLE>
</HEAD>
<BODY>
<H1>Booking Status</H1>
<P> </P>
<P> </P>
<SCRIPT language=JavaScript>
<!--
alert("Welcome!")
--><!--EndFragment-->
</SCRIPT>
<%
Dim user
user = Trim(Request("user"))
Response.Write("User ID is " & user & " ")
%>
</BODY>
</HTML>
Last edited by Shadow Wizard : June 26th, 2005 at 10:00 AM. Reason: added code tags - please do it yourself with [code] and [/code] tags next. |
|
#2
|
||||
|
||||
|
Depends on what you want to. Do you want the ASP to return the value to the VB6 app immediately after you pass it to the ASP page? How do you want to retreive the value? You could use XML objects to make an HTTP call and grab the response that it returns. Then you can search the return value for your answer. Here is a vbscript Example. In this example, you pass in a 1 and 2. The asp page will add it and return 3:
strHttp = "http://www.site.com/file.asp?x=1&y=2&type=add" Set objHTTP = CreateObject("Msxml2.ServerXMLHTTP.3.0") objHTTP.open "GET", strHttp, false objHTTP.send strHttpRet = objHTTP.ResponseBody objHTTP.Close msgbox strHttpRet The strHttpRet will contain the http response. You can view it and extract what you are looking for. Is this what you are interested in doing? |
|
#3
|
||||
|
||||
|
--moved to the VB forum.
what you need is the same code posted by dcarva but for VB - having this, you'll be able to read the ASP "response" from within the VB code. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Working code to pass values from vb6 to asp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|