Download of ActiveX control from web

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?
emidiodAsked:
Who is Participating?
 
b1xml2Connect With a Mentor Commented:
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
 
webwomanCommented:
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
 
emidiodAuthor Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
webwomanCommented:
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
 
emidiodAuthor Commented:
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
 
webwomanCommented:
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
 
emidiodAuthor Commented:
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
 
b1xml2Commented:
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
 
webwomanCommented:
Doesn't that refresh the whole page?
0
 
b1xml2Commented:
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
 
AzraSoundCommented:
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
 
emidiodAuthor Commented:
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
 
b1xml2Commented:
emidiod, any questions regarding the ASP application scope code, pls post here and I will answer them.

thanx
0
All Courses

From novice to tech pro — start learning today.