Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Issue with xmlhttp
Message
De
24/11/2008 17:05:59
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Issue with xmlhttp
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01363859
Message ID:
01363859
Vues:
74
Have been using xmlhttp to get shipping rates from UPS. Now want to detect case where client is not connected to internet so can handle gracefully. If disconnect from Internet and run program, get error 0 at lcxml =oxmlhttp.responsetext statement below. Tried to intercept with on error, but success seems to depend on whether am in debugger or not.

How can I best detect user is not connected to internet using the xmlhttp object? Thanks.
oXMLHttp = CREATEOBJECT("Microsoft.xmlhttp")
oXMLHttp.open("POST", "https://wwwcie.ups.com/ups.app/xml/Rate", .T.)
oXMLHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
xx=alltrim(holdxml.holdxml)  && this is a memo field in the holdxml table which holds the request string
oXMLHttp.send(xx)
lcxml=oxmlhttp.responsetext
**11-24-08 intercept error with on error()
IF problem  && connecting to internet
	**handle the problem
else
	= XMLTOCURSOR(lcxml,"")  && transfer xml return to xmlresult cursor
	*etc.
endif
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform