<% language = vbscript %> <% Const geocoderUsername = "your_username_here", geocoderPassword = "your_password_here" %> <% ' This code will only work if your webhost has not disabled use of ' the MS XMLhttp component. If you encounter problems, then contact your host ' or think about making the remote call using AJAX technology geocoderURL = "http://geocoder.us/member/service/csv/geocode?address=1600+Pennsylvania+Ave%2C+Washington+DC" geocoderData = GetRemoteContent (geocoderURL,geocoderUsername,geocoderPassword) if left(geocoderData,2) <> "1:" &_ and left(geocoderData,2) <> "2:" &_ and left(geocoderData,4) <> "ERR:" &_ and left(geocoderData,5) <> "city:" then ' this error check probably does not cover all possible ' responses from geocoder.us, but it's all I know of geocoderDataArray = split(geocoderData, ",", -1, 1) currPropertyLatitude = geocoderDataArray(0) currPropertyLongitude = geocoderDataArray(1) currPropertyAddress = geocoderDataArray(2) currPropertyCity = geocoderDataArray(3) currPropertyState = geocoderDataArray(4) currPropertyZip = geocoderDataArray(5) else ' error, do whatever end if %> <% Function GetRemoteContent(TheURL, TheUsername, ThePassword) 'create an instance of the MS XMLhttp component. 'this is the old version, use new if you can 'Set xmlObj = Server.CreateObject("Microsoft.XMLHTTP") 'this is the new version Set xmlObj = Server.CreateObject("MSXML2.ServerXMLHTTP") 'Open the connection and send the request xmlObj.Open "GET", TheURL, false, TheUsername, ThePassword Call xmlObj.Send() 'Did an error occur? If so, use a default value for our data If Err.Number <> 0 Then GetRemoteContent = "ERR: There was an error retrieving the remote page" Else 'If we reach here, we know the server responded 'To accommodate for unexpected behaviors ensure the 'readyState property equals 4 'and the Status property, which returns the HTTP Response status, 'equals 200 If (xmlObj.readyState <> 4) Or (xmlObj.Status <> 200) Then 'Abort the request xmlObj.Abort GetRemoteContent = "ERR: Problem communicating with remote server..." Else GetRemoteContent = xmlObj.ResponseText End If End If set xmlObj = nothing End Function %>