passing values from visual basic to vb script or javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karthik_c
    New Member
    • Jul 2006
    • 1

    passing values from visual basic to vb script or javascript

    Hi,

    Anyone know how to pass a value textbox value from a VB6 activex control to vbscript.



    thanks in advance,
    karthik
    Last edited by karthik_c; Jul 14 '06, 06:10 AM.
  • tf-centurion
    New Member
    • Jul 2006
    • 3

    #2
    HI karthik_c,

    The only way i know of would be via cookies.

    Heres some code below i found on the web a while back about setting cookies in vb6.


    Start with a new project and a single form. Add two Command buttons to the form: cmdMakeCookie and cmdGetCookie. Drop in this code and then try it out.


    Private Declare Function InternetSetCook ie Lib "wininet.dl l" _
    Alias "InternetSetCoo kieA" _
    (ByVal lpszUrlName As String, _
    ByVal lpszCookieName As String, _
    ByVal lpszCookieData As String) As Boolean

    Private Declare Function InternetGetCook ie Lib "wininet.dl l" _
    Alias "InternetGetCoo kieA" _
    (ByVal lpszUrlName As String, _
    ByVal lpszCookieName As String, _
    ByVal lpszCookieData As String, _
    lpdwSize As Long) As Boolean

    Private Sub cmdMakeCookie_C lick()
    Dim blnReturn As Boolean

    blnReturn = InternetSetCook ie("http://abstractvb.com/MyCookie.htm", _
    "MyCookiesName" , "Put Cookie Information Here")

    If Not blnReturn Then MsgBox "Make Cookie Operation Failed!", vbCritical
    End Sub

    Private Sub cmdGetCookie_Cl ick()
    Dim strCookieText As String * 256
    Dim blnReturn As Boolean

    blnReturn = InternetGetCook ie("http://abstractvb.com/MyCookie.htm", _
    "MyCookiesName" , strCookieText, 255)
    If Not blnReturn Then
    MsgBox "Get Cookie Operation Failed", vbCritical
    Else
    MsgBox strCookieText, vbInformation
    End If
    End Sub

    Hope this helps

    Comment

    Working...