Solved

Scrolling Text using VBScript

Posted on 2002-05-10
14
1,225 Views
Last Modified: 2008-02-01
OK, I'm an experienced VB programmer, but I'm still getting my feet wet coding with ASP/VBScript/JavaScript, so bear with me...

I'm trying to add a scrolling marquee, just like at http://javascript.internet.com/scrolls/multiple-message-scroller.html.  However, I'd like to use VBScript instead of JavaScript.  The main reason is that I'd like to call an ActiveX dll to make some back-end DB calls.  Basically, the call to the dll will retrieve the appropriate message, after checking things like security and stuff.  Now, if I can call that dll using JavaScript to get the information, that'd be great also.

Just to give you how things are arranged, I have an .htm file that is currently using JavaScript that resides in other files.  Can I mix JavaScript and VBScript in the same file?
0
Comment
Question by:kcleary
  • 7
  • 6
14 Comments
 
LVL 23

Expert Comment

by:b1xml2
ID: 7001571
1. Using an ActiveX Control (ocx which is compiled as a cab file) for the web browser (not ActiveX DLL) will restrict your browser to MSIE4+. ActiveX Controls created via VB can be both slow and bloated in size.

2. There are numerous ways to send data back to a web server that hides the details of the db and for which is the preferred technique for traditional ASP Applications. For ASP.NET, the preferred way is to consume web services in web applications or perform .NET remoting for which a web server and the http protocol is not necessary at all.

3. Yes, you can mix Javascript and VBScript in the same file. Just make sure not to have duplicate variable names. VBScript is case-insensitive whereas Javascript is case sensitive.

After all, this is the ASP Topic Area =)

Cheers.
0
 

Author Comment

by:kcleary
ID: 7001597
There's already an ActiveX DLL in place to handle stored procedure calls to the back-end DB, so I need to use that.  I'm trying to call that DLL from JavaScript, but I'm having problems.  I'm trying the following...

var objProdCustData = new ActiveXObject("dllname.classname")

The DLL resides on the server, so I'm not sure what I need to do.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7001637
newObj = new ActiveXObject(servername.typename[, location])

e.g.
var oProdCustData = new ActiveXObject("dllname.classname","myserver"); if you wish to instantiate the dll residing on the server. The dll will be hosted on the client's namespace and not server.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:kcleary
ID: 7001700
OK, I know that command works, but I'm having problems finding the DLL.  It's registered on my PC, and is residing in a folder under Inetpub (on the localhost...using PWS).  I've tried adding a location, but nothing seems to work right.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7001756
if you are using PWS, sorry no such luck, You need to develop using IIS in Windows 2000 or Windows NT, workstation or server makes little difference for dev work. Certainly not PWS.
0
 

Author Comment

by:kcleary
ID: 7001855
So why does this work on PWS

var objProdCustData=new ActiveXObject("MsComDlg.CommonDialog");

but this does not

var objProdCustData=new ActiveXObject("ProdCustData_XML.crm");
0
 

Author Comment

by:kcleary
ID: 7001863
Oh, and it is IIS on Windows 2000.
0
 

Author Comment

by:kcleary
ID: 7001869
Oh, and it is IIS on Windows 2000.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7001874
as I have pointed out, inside MSIE, you generally host ActiveX Controls if you create them yourself with VB. There are numerous issues at hand. Furthermore, the common dialog is an ActiveX Control comdlg32.ocx
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7001884
tip, create an activex control. it basically will do that you need. compile it and distribute it as a cab file. Then under InterDev or FrontPage, add that activex control and you can make it visible. This is achieved by using the OBJECT tag which allows for the downloading and installation of the ActiveX Control.

Best Of Luck
0
 
LVL 15

Expert Comment

by:robbert
ID: 7003006
> The main reason is that I'd like to call an ActiveX dll to make some back-end DB calls.

To connect to a remote component via DCOM, you would need to register the component's typelib on the client computer. I guess that's not an option.

Instead, you would use Remote Scripting:
http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/msdn-files/027/001/734/msdncompositedoc.xml

Architecture, concisely:
Client-side Java applet which can be queried by JavaScript, and does remote HTTP requests to the server. At the server, you can call custom functions located in ASP documents.
Works with IE and NN.
0
 
LVL 23

Accepted Solution

by:
b1xml2 earned 200 total points
ID: 7003019
robbert,

either that or use the XMLHTTP Object to pass data to and from the web server. Remote Scripting although is a cross browser implementation suffers from some severe deficiency including the amount of data that can be sent to and from the server. This is probably due to the limitations of the rsproxy.class java applet is invoked on the client.

It might interest you to know that NS 6.2 supports XMLHTTP albeit the syntax is XMLHTTPRequest =).

Since the asker has yet to object to an MSIE all implementation, Remote Scripting can be ditched. The beauty of use the XMLHTTP approach is:

1. Most MSIE5+ have it already installed.
2. You can use scripts to autodetect XML Parser on the client and where there is none, to re-direct to a software download page where an automated download is instantiated.
3. The XMLHTTP Object basically allows for a traditional client-server application for a web application.
4. The 1500 bytes limitation of the remote scripting applet of course can be circumvented by some ugly workaround. The XMLHTTP Object has no such horrible upper limits/
0
 

Author Comment

by:kcleary
ID: 7008912
Thanks for the help b1xml2...I took some of your stuff and incorporated it into some other things I found.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7009955
Most welcome, kcleary =)).
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to update a dummy recordset with classic ASP 4 98
ASP SQL Syntax Duplicate Key 7 110
Recordset containing single quotes 8 43
Query still returning duplicates 5 41
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

791 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