Solved

Scrolling Text using VBScript

Posted on 2002-05-10
14
1,189 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:kcleary
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Oh, and it is IIS on Windows 2000.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

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

Expert Comment

by:b1xml2
Comment Utility
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
Comment Utility
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
Comment Utility
> 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
Comment Utility
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
Comment Utility
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
Comment Utility
Most welcome, kcleary =)).
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
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/…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now