Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-01-2004, 12:51 PM
WebProWorld Member
 

Join Date: Feb 2004
Location: New York
Posts: 75
JSeverson RepRank 0
Default ASP/XML Object Problem

Hi,
I am trying to use an XML object in ASP to retrieve the current weather condition. Depending on the weather, a particular flash file will then be displayed. The problem, which I experienced today, is that the site that I was trying to retrieve the weather from was down and, obviously, I received an error on my end.

The error that I received was:

msxml3.dll error '800c0005'
The system cannot locate the resource specified.
/redesign/includes/weather.asp, line 19

Part of the code that is generating the error is below:

myZip = 12487 'Ulster Park, NY
URL = "http://www.wunderground.com/cgi-bin/findweather/getForecast?query="&myZip

'create our XMLHTTP object
set http_obj = createObject("Microsoft.XMLHTTP")
call http_obj.Open("GET",URL,false)
call http_obj.Send()

Line 19 is the line "call http_obj.Send()". Is there any way to have some sort of error control in this code (i.e. If the site is down, just display a default Flash movie)?

Thanks,
__________________
Jeff T. Severson
J.T.S. Design, Inc.
Reply With Quote
  #2 (permalink)  
Old 09-01-2004, 01:53 PM
WebProWorld Pro
 

Join Date: Aug 2004
Location: UK
Posts: 130
SteveF RepRank 0
Default

Try the old;

on error resume next

and then after the object call test for an error, if an error has occurred (object not created) then do something else

if err then
other code that does something else

Hope that helps, worth a try! Might not be perfect or work at all!!!
(works for my Cdonts mail when something wrong with server!)
__________________
SteveF
Projectors
Reply With Quote
  #3 (permalink)  
Old 09-01-2004, 10:33 PM
WebProWorld Member
 

Join Date: Feb 2004
Location: New York
Posts: 75
JSeverson RepRank 0
Default

Thanks. I tried using On Error Resume Next and it appears to have worked. I tried changing the URL where the data is retrieved from to several different sites, some that exist and some that don't, and the error that was occuring before didn't come up again.

Thanks again,
__________________
Jeff T. Severson
J.T.S. Design, Inc.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0