Solved

Download of ActiveX control from web

Posted on 2002-04-10
13
305 Views
Last Modified: 2008-02-01
My control is downloading on some peoples machines and not others.  

They have the settings for their browser set to download control, but it is not working for some.

How can i get it to work on everyones computer that says it is OK to download the control?
0
Comment
Question by:emidiod
  • 4
  • 4
  • 4
  • +1
13 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 6934039
You can't. If they're using Netscape, it's not going to work because ActiveX doesn't work on Netscape without a plugin, which they likely won't have. If they're using AOL, it probably won't work because the AOL browser is different. If they're using a Mac, it likely won't work because you've probably done something that's not Mac friendly. If you're calling a component/app that they don't have installed, it won't work because it's missing a piece. If they don't have the right permissions on their machine to install ActiveX controls, it won't work even if it downloads because they're not permitted to install things.

This is why I don't use ActiveX. ;-)
0
 

Author Comment

by:emidiod
ID: 6934472
Thanks webwoman...i am aware of these things;-).  They are all using IE5 or IE6 and they have all set their security appropriately and it is still not working for some.  

I would abandon ActiveX if i could use a timer on the server side or had some way of refreshing the server side data on a timed interval.
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6934605
You don't need to refresh the server side data. Refresh the client side page. If it's a server side script, it will grab new data if there's any there.

Of course, that's assuming that they don't have their cache set to NEVER reload the info... in which case, use the no-cache options to override that.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:emidiod
ID: 6934765
I do not want to use the following:

<META HTTP-EQUIV="REFRESH" Content="5">

on the client side because it looks bad.  I just want to updatte a few images based on data coming from the server.
How do i refresh or requery the recordset on the server every 5 seconds?
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6936014
Why don't you want to use the meta tag? You can't refresh just part of the page, you need to reload the entire thing. And the easiest way to do that is with a meta tag.
0
 

Author Comment

by:emidiod
ID: 6936163
Becuase the whole page flickers...it does not look very good.  I really just want to refresh the recordset on the server side and just update small light images on the client side...not the background picture.
0
 
LVL 23

Accepted Solution

by:
b1xml2 earned 200 total points
ID: 6939800
emidiod, as from the ASP solution given earlier,
you use the existing XMLHTTP ActiveX Control to do that.

Also, if you want to persist Data across sessions and pages, you shd use MSXML Parser to do this in application scope and have a timed update of the data from the server to provide scalability of the web app,let's say a fixed update interval of data every 5 seconds at the web server regardless of how often the clients are calling.

Again, the progids
MSXML2.0 - 2.5 "Microsoft.FreeThreadedXMLDOM"
MSXML 3.0 "Msxml2.FreeThreadedDOMDocument.3.0"
MSXML 4.0 "Msxml2.FreeThreadedDOMDocument.4.0"

e.g.
global.asa
<object id="oPersist"
 progid="Msxml2.FreeThreadedDOMDocument"
 scope="application"
 runat="server"></object>
<script language="VBScript" runat="server">

Sub Application_OnStart()
 oPersist.async = False
 'set the encoding to support iso-8859-1 char set
 oPersist.appendChild oPersist.createProcessingInstruction("xml","version='1.0' encoding='iso-8859-1'")
 'create the root element
 oPersist.appendChild oPersist.createElement("root")
 'timestamp default is 0
 oPersist.documentElement.setAttribute "timestamp" , 0
End Sub


Sub Application_OnEnd()
 'remove processing instruction
 oPersist.removeChild oPersist.childNodes.item(0)
 'remove root element
 oPersist.removeChild oPersist.documentElement
End Sub
</script>

dates.asp
=========
<%
Function DateToSeconds(ByVal datDate)
On Error Resume Next
DateToSeconds = DateDiff("s",DateValue("January 1 2002"),datDate)
End Function
%>


db.asp
(additional module referring to timed updates of data regardless of clients uploading data)
======
<%
 Response.Buffer = True
 Response.ContentType = "text/xml"
 Response.Expires = -1
 Response.AddHeader "Pragma","no-cache"
 Response.CacheControl = "no-cache"
%>
<!--#include file="library/dates.asp"-->
<!--#include file="library/functions.asp"-->
<%
 Dim INTERVAL_IN_SECONDS_TO_UPDATE_DATA
 INTERVAL_IN_SECONDS_TO_UPDATE_DATA = 2
 Dim dblTimestamp, oData, oTimestamp, dblDBTimestamp, oNode
 Dim oNode, vtName, vtValue
 dblTimestamp = DateToSeconds(Now)
 dblDBTimestamp = -1
 Set oData = Application.StaticObjects("oPersist")
 Set oTimestamp = oData.documentElement.attributes.getNamedItem("timestamp")
 If Not oTimestamp Is Nothing Then
  dblDBTimestamp = CDbl(oTimestamp.nodeValue)
  If (dblTimestamp - dblDBTimestamp) > INTERVAL_IN_SECONDS_TO_UPDATE_DATA Then
  Application.Lock
  '......OPERATIONS TO RETRIEVE FROM DATABASE
  '....code
  While Not oRS.EOF
   For Each oField In oRS.Fields
   vtName = oField.Name
   vtValue = oField.Value
   Set oNode = oData.selectSingleNode("//item[@name=" & vtName & "]")
  If oNode Is Nothing Then
  AddAttributes AddElement(oData.documentElement,"item"), _
   Array("name",vtName,"state",vtValue)
  Else
   AddAttributes oNode, Array("name",vtName,"state",vtValue)

  End If
  Next
  oRS.MoveNext
  Wend
  'CODE TO CLOSE RECORDSET
  'END CONNECTION TO DB
  Application.Unlock
  End If
  Set oTimestamp = Nothing
 End If
 oData.save Response
 Set oData = Nothing
%>

The code in the db.asp will protect unnecessary connections to the database and ensure that the data is more-or-less updated at 2 second intervals

Regards,

Brandon Driesen
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6939803
reposting db.asp, forgot to add new timestamp value!!

db.asp
(additional module referring to timed updates of data regardless of clients uploading data)
======
<%
Response.Buffer = True
Response.ContentType = "text/xml"
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Response.CacheControl = "no-cache"
%>
<!--#include file="library/dates.asp"-->
<!--#include file="library/functions.asp"-->
<%
Dim INTERVAL_IN_SECONDS_TO_UPDATE_DATA
INTERVAL_IN_SECONDS_TO_UPDATE_DATA = 2
Dim dblTimestamp, oData, oTimestamp, dblDBTimestamp, oNode
Dim oNode, vtName, vtValue
dblTimestamp = DateToSeconds(Now)
dblDBTimestamp = -1
Set oData = Application.StaticObjects("oPersist")
Set oTimestamp = oData.documentElement.attributes.getNamedItem("timestamp")
If Not oTimestamp Is Nothing Then
 dblDBTimestamp = CDbl(oTimestamp.nodeValue)
 If (dblTimestamp - dblDBTimestamp) > INTERVAL_IN_SECONDS_TO_UPDATE_DATA Then
 Application.Lock
 'UPDATE TIMESTAMP
 oData.documentElement.setAttribute "timestamp", dblTimestamp
 '......OPERATIONS TO RETRIEVE FROM DATABASE
 '....code
 While Not oRS.EOF
  For Each oField In oRS.Fields
  vtName = oField.Name
  vtValue = oField.Value
  Set oNode = oData.selectSingleNode("//item[@name=" & vtName & "]")
 If oNode Is Nothing Then
 AddAttributes AddElement(oData.documentElement,"item"), _
  Array("name",vtName,"state",vtValue)
 Else
  AddAttributes oNode, Array("name",vtName,"state",vtValue)

 End If
 Next
 oRS.MoveNext
 Wend
 'CODE TO CLOSE RECORDSET
 'END CONNECTION TO DB
 Application.Unlock
 End If
 Set oTimestamp = Nothing
End If
oData.save Response
Set oData = Nothing
%>
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6940026
Doesn't that refresh the whole page?
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6940033
no, webwoman,
the code provided in the ASP section uses the XMLHTTP Object and as you can well see, the page is dished out as an XML Document.

so no, the whole page is NOT refreshed and that is the whole modus operandi and raison d'etre of using XMLHTTP on the client side.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6940553
I believe some people do this with a timer on the client side running in a framed page.  it calls the asp page to do refreshing in the other frame (which is sized so small its not even visible) which, once it processes on the server, comes back and scripts across to the other frame updating its contents.
0
 

Author Comment

by:emidiod
ID: 6940820
Thanks Brandon...i have not tried this yet, but based on the last excellent solution you gave me, you know what you're talking about...i will keep the faith:)
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6940854
emidiod, any questions regarding the ASP application scope code, pls post here and I will answer them.

thanx
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
keyword rich ebay title, description 2 50
Shopping Cart 2 85
Need help deploying my first MVC.Net app with a SQL Server backend 3 26
PHP Curl to output a url 7 53
Read about why website design really matters in today's demanding market.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

820 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