Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 20th, 2005, 10:56 PM
cherish cherish is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 2 cherish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 49 sec
Reputation Power: 0
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>&nbsp;</P>
<P>&nbsp;</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.

Reply With Quote
  #2  
Old June 22nd, 2005, 05:39 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
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?

Reply With Quote
  #3  
Old June 26th, 2005, 10:07 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,638 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 3 h 2 m 52 sec
Reputation Power: 1902
--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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Working code to pass values from vb6 to asp


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT