Solved

Download of ActiveX control from web

Posted on 2002-04-10
13
298 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
 

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
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.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

760 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

21 Experts available now in Live!

Get 1:1 Help Now