Codefixer - ASP tutorials, resources and software
ASP.NET Hosting with US & UK Data Centers!
Home   Articles   Resources   ASP directory   ASP Tutorials   Code Snippets   ASP Applications   Forum
Monday 6 October
MembersPro PayPal - ASP Membership software

New MS SQL 2008 Available – DiscountASP.NET


ASP Partner ASP Partner ASP Partner more partners...

Testing for the XMLHTTP Request object

Run the script to test whether you have the XMLHTTP Request object installed that comes with any version of the Microsoft XML Parser (MSXML).

<% Option Explicit %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>XMLHTTP Request Object</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
'put the objects that we wish to test for into a declared array
Dim InstalledObjects(4)

InstalledObjects(0) ="Microsoft.XMLHTTP"
InstalledObjects(1) ="Msxml2.ServerXMLHTTP"
InstalledObjects(2) ="MSXML2.ServerXMLHTTP"
InstalledObjects(3) ="MSXML2.XMLHTTP.3.0"
InstalledObjects(4) ="MSXML2.XMLHTTP.4.0"

Function ObjCreated(sClass)
'create variable
Dim ObjInstance
On Error Resume Next
'initialize default values
ObjCreated = False
'create instance of the class - an object
Set ObjInstance = Server.CreateObject(sClass)
If Err.Number=0 Then ObjCreated = True
'close object
Set ObjInstance = Nothing
Err.Clear
End Function
%>
<table border="0">
<%
Dim i
For i=0 to UBound(InstalledObjects)
Response.Write "<tr><td>" & InstalledObjects(i) & "</td><td>"
If ObjCreated(InstalledObjects(i)) Then
Response.Write "<strong>Installed</strong>"
Else
Response.Write "<strong>not installed</strong>"
End If
Response.Write "</td></tr>"
Next
%>
</table>
</body>
</html>


LinksPro - Directory  and Link  Management Software




If you have any code snippets to share with full credit given then send an email to Codesnippets - You'll receive full credit and a link back to your site.

ASP.NET 3.5/2.0 Web Hosting: 3 Months FREE – Click Here!




About | Contact | Advertise | Feedback | Hire Us | Link

Site developed by Michael Wall - Web Design Belfast N.Ireland.
Copyright © 2000-2008. All rights reserved.

Do you intend to move to ASP.NET or have you already?
Yes will do
Have done
ASP does fine
Not a priority


Directory Software