DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Evan Miller Guest

    Please Help - Scripting Problems....

    Hey All

    I am doing up a application porting page in ASP+. The problem is that I
    cannot get the ASP+ code toi talk to the client-side VBScript functions, or
    the ActiveX object. Here's my source::
    I have marked the line that doesnt happen. 1 MILLION THANKS in ADVANCE!
    <HTML>
    <HEAD>
    <%@ Page Language="VB" %>
    <%@ Import Namespace="System.Data.SQL" %>
    <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="System" %>

    <script language=VBScript>

    Sub start
    MsTsc.Disconnect
    MsTsc.Server = "DOTNETSERVER"
    MsTsc.Domain = "DOTNETSERVER"
    MsTsc.UserName = "IUSR_DOTNETSERVER"
    MsTsc.Connect
    end sub

    Sub stopit
    MsTsc.Disconnect
    end sub

    </script>

    <script language="VB" runat="server">

    Dim Temp As String
    Dim UserDetail As TBW.CustomerDetails= new TBW.CustomerDetails()
    Dim SystemDetail As TBW.SystemDB= new TBW.SystemDB()

    Sub RemoveCookie(COOKIE_NAME As String)
    objCookieObject = New HttpCookie(COOKIE_NAME)

    ' Expire it on the day I was born just so we're sure it's a date in the
    past.
    objCookieObject.Expires = New DateTime(1975,12, 04)

    Response.AppendCookie(objCookieObject)
    End Sub

    Function GetCookie() As String
    objCookieObject = Request.Cookies("TBW_Username")

    If Not(objCookieObject = Nothing) Then
    GetCookie = objCookieObject.Value
    RemoveCookie("TBW_Username")
    Else
    GetCookie = ""
    End If

    End Function

    Sub Login

    Dim MyReader as SQLDataReader
    Dim MyConnection as SQLConnection
    Dim UsersDSCommand as SQLCommand
    Dim SQL as String

    Dim Flag As Boolean

    MyConnection = new
    SQLConnection("server=*******;uid=**;pwd=*******;database=*******")
    Flag = False
    Temp = GetCookie()
    MyConnection.Open()
    SQL = "SELECT * FROM onlineuser WHERE (Username ='" & Temp & "')"
    UsersDSCommand = new SQLCommand(SQL, MyConnection)
    UsersDSCommand.Execute(MyReader)
    While MyReader.Read()
    If MyReader("UserName").ToString() = Temp then
    Flag = True
    end if
    end While
    MyReader.Close()

    If flag = True then
    VBScript:start() ***RIGHT HERE IT DIES!!! I NEED IT TO RUN THE
    VBSCRIPT FUNCTION!!!
    else
    Logout
    end if
    end Sub

    Sub Logout
    SystemDetail.Disconnect(Temp)
    end Sub

    </script>



    </HEAD>
    <BODY bgcolor="#000000" vlink="#FFFFFF" alink="#FFFFFF" link="#FFFFFF"
    OnLoad="Login" OnUnload="stopit; Logout">
    <a href="#" onclick="stopit; Logout; window.close">Click to Close</a>
    <object id=MsTsc codeBase=mstscax.cab#version=-1,-1,-1,-1
    classid=CLSID:1fb464c8-09bb-4017-a2f5-eb742f04392f width="100%"
    height="100%" VIEWASTEXT>
    <param NAME="Server" VALUE="">
    <param NAME="Domain" VALUE="">
    <param NAME="UserName" VALUE="">
    <param NAME="FullScreen" VALUE="">
    <param NAME="StartConnected" VALUE="0">
    </object>
    </BODY>
    </HTML>




  2. #2
    Evan Miller Guest

    Re: Please Help - Scripting Problems....

    Ok... So I found out that asp+ does not support vbscript.. fine, whatever...

    So now the $64K(not like I have it) is:

    How do I get the server side VB code to talk to the activeX control on the
    client?

    Right now it says "MsTsc" is not declared.. Any thoughts???

    Thanks



    "Evan Miller" <mesonuts@hotmail.com> wrote in message
    news:3a27d781$1@news.devx.com...
    > Hey All
    >
    > I am doing up a application porting page in ASP+. The problem is that I
    > cannot get the ASP+ code toi talk to the client-side VBScript functions,

    or
    > the ActiveX object. Here's my source::
    > I have marked the line that doesnt happen. 1 MILLION THANKS in ADVANCE!
    > <HTML>
    > <HEAD>
    > <%@ Page Language="VB" %>
    > <%@ Import Namespace="System.Data.SQL" %>
    > <%@ Import Namespace="System.Data" %>
    > <%@ Import Namespace="System" %>
    >
    > <script language=VBScript>
    >
    > Sub start
    > MsTsc.Disconnect
    > MsTsc.Server = "DOTNETSERVER"
    > MsTsc.Domain = "DOTNETSERVER"
    > MsTsc.UserName = "IUSR_DOTNETSERVER"
    > MsTsc.Connect
    > end sub
    >
    > Sub stopit
    > MsTsc.Disconnect
    > end sub
    >
    > </script>
    >
    > <script language="VB" runat="server">
    >
    > Dim Temp As String
    > Dim UserDetail As TBW.CustomerDetails= new TBW.CustomerDetails()
    > Dim SystemDetail As TBW.SystemDB= new TBW.SystemDB()
    >
    > Sub RemoveCookie(COOKIE_NAME As String)
    > objCookieObject = New HttpCookie(COOKIE_NAME)
    >
    > ' Expire it on the day I was born just so we're sure it's a date in the
    > past.
    > objCookieObject.Expires = New DateTime(1975,12, 04)
    >
    > Response.AppendCookie(objCookieObject)
    > End Sub
    >
    > Function GetCookie() As String
    > objCookieObject = Request.Cookies("TBW_Username")
    >
    > If Not(objCookieObject = Nothing) Then
    > GetCookie = objCookieObject.Value
    > RemoveCookie("TBW_Username")
    > Else
    > GetCookie = ""
    > End If
    >
    > End Function
    >
    > Sub Login
    >
    > Dim MyReader as SQLDataReader
    > Dim MyConnection as SQLConnection
    > Dim UsersDSCommand as SQLCommand
    > Dim SQL as String
    >
    > Dim Flag As Boolean
    >
    > MyConnection = new
    > SQLConnection("server=*******;uid=**;pwd=*******;database=*******")
    > Flag = False
    > Temp = GetCookie()
    > MyConnection.Open()
    > SQL = "SELECT * FROM onlineuser WHERE (Username ='" & Temp & "')"
    > UsersDSCommand = new SQLCommand(SQL, MyConnection)
    > UsersDSCommand.Execute(MyReader)
    > While MyReader.Read()
    > If MyReader("UserName").ToString() = Temp then
    > Flag = True
    > end if
    > end While
    > MyReader.Close()
    >
    > If flag = True then
    > VBScript:start() ***RIGHT HERE IT DIES!!! I NEED IT TO RUN THE
    > VBSCRIPT FUNCTION!!!
    > else
    > Logout
    > end if
    > end Sub
    >
    > Sub Logout
    > SystemDetail.Disconnect(Temp)
    > end Sub
    >
    > </script>
    >
    >
    >
    > </HEAD>
    > <BODY bgcolor="#000000" vlink="#FFFFFF" alink="#FFFFFF" link="#FFFFFF"
    > OnLoad="Login" OnUnload="stopit; Logout">
    > <a href="#" onclick="stopit; Logout; window.close">Click to Close</a>
    > <object id=MsTsc codeBase=mstscax.cab#version=-1,-1,-1,-1
    > classid=CLSID:1fb464c8-09bb-4017-a2f5-eb742f04392f width="100%"
    > height="100%" VIEWASTEXT>
    > <param NAME="Server" VALUE="">
    > <param NAME="Domain" VALUE="">
    > <param NAME="UserName" VALUE="">
    > <param NAME="FullScreen" VALUE="">
    > <param NAME="StartConnected" VALUE="0">
    > </object>
    > </BODY>
    > </HTML>
    >
    >
    >




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links