Address Standardization

Address Standardization is.....................
Input Address

 

Address ">
City ">
State ">
Zip Code ">
 

<% Dim InitErrStr Dim VerStatus Dim GZip Dim CompDistance Dim AddStd Dim Buffer Dim FormatFlg Dim OkProcess Dim OkStandardize Dim InitVal Dim InitValZip Dim Message Dim ZipTypeMessage Dim AddressTypeMessage Dim strRef Dim strStatusCode Dim strErrorCode Dim strAddress Dim strAddress2 Dim strSuite Dim strCity Dim strState Dim strZip Dim strPlus4 Dim strAddressTypeCode Dim strAddressTypeString Dim strCarrierRoute Dim strDeliveryPointCode Dim strCountyName Dim strCountyFips Dim strMsa Dim strPmsa Dim strTimeZone Dim strTimeZoneCode Dim strCongressionalDistrict Dim strLatitude Dim strLongitude Dim strAreaCode Dim strCBSStatusCode strStatusCode = "" strErrorCode = "" strAddress = "" strAddress2 = "" strSuite = "" strCity = "" strState = "" strZip = "" strPlus4 = "" strAddressTypeCode = "" strAddressTypeString = "" strCarrierRoute = "" strDeliveryPointCode = "" strCountyName = "" strCountyFips = "" strMsa = "" strPmsa = "" strTimeZone = "" strTimeZoneCode = "" strCongressionalDistrict = "" strLatitude = "" strLongitude = "" strAreaCode = "" strCBSStatusCode = "" OkProcess=0 strRef=Request.ServerVariables("HTTP_REFERER") If Left(strRef,32) <> "http://www.cypressesolutions.com" Then Response.Redirect("/") End If If strRef = "http://www.cypressesolutions.com/address.asp" Then OkProcess = 1 End If If OkProcess=1 Then Set AddStd = Server.CreateObject("AddressObject.AddressCheck") Set AddZip = Server.CreateObject("AddressObject.ZipCodeData") If (AddStd.SetLicenseString("3G-29M-6G2") <> 1) Then Response.Write "Address License String Error." AddStd = nothing Response.End End If If (AddZip.SetLicenseString("3G-29M-6G2") <> 1) Then Response.Write "Zip License String Error." AddStd = nothing Response.End End If AddStd.PathToUSFiles = "C:\Program Files\Melissa DATA\COM Objects\Data Files" AddStd.PathToCanadaFiles = "" AddStd.PathToDPVDataFiles = "C:\Program Files\Melissa DATA\COM Objects\Data Files" InitVal = AddStd.InitializeDataFiles() If (InitVal <> 0) Then InitErrStr = AddStd.GetInitializeErrorString() response.write "Address ERROR: " & InitErrStr & " (" & InitVal & ")" Else InitValZip = AddZip.Initialize("C:\Program Files\Melissa DATA\COM Objects\Data Files", "C:\Program Files\Melissa DATA\COM Objects\Data Files", "") If (InitValZip <> 0) Then InitErrStr = AddZip.GetInitializeErrorString() response.write "Zip ERROR: " & InitErrStr & " (" & InitVal & ")" Else AddStd.Address = Request("Address1") AddStd.City = Request("City") AddStd.State = Request("State") AddStd.Zip = Request("Zip") VerStatus = AddStd.VerifyAddress() GZip = AddZip.FindZip(AddStd.Zip) CompDistance = AddZip.ComputeDistance (34.0380, -84.5940, AddZip.Latitude, AddZip.Longitude) strStatusCode = AddStd.StatusCode & " - " strErrorCode = AddStd.ErrorCode strAddress = AddStd.Address strAddress2 = AddStd.Address2 strSuite = AddStd.Suite strCity = AddStd.City strState = AddStd.State strZip = AddStd.Zip strPlus4 = AddStd.Plus4 strAddressTypeCode = AddStd.AddressTypeCode & " - " strAddressTypeString = AddStd.AddressTypeString strCarrierRoute = AddStd.CarrierRoute strDeliveryPointCode = AddStd.DeliveryPointCode strCountyName = AddStd.CountyName strCountyFips = AddStd.CountyFips strMsa = AddStd.Msa strPmsa = AddStd.Pmsa strTimeZone = AddStd.TimeZone strTimeZoneCode = AddStd.TimeZoneCode strCongressionalDistrict = AddStd.CongressionalDistrict strLatitude = AddZip.Latitude strLongitude = AddZip.Longitude strAreaCode = AddZip.AreaCode If (AddStd.AddressTypeCode = "H") and (AddStd.Suite = "") Then Message = "Address Missing Unit Number" strStatusCode = "CU" strCBSCode = "P1" ElseIf AddStd.ErrorCode = "C" Then Message = "Canadian Postal Code" strStatusCode = "CC" strCBSCode = "P2" ElseIf AddZip.ZipType = "M" Then Message = "Military Address" strStatusCode = "CM" strCBSCode = "P3" Else Select Case AddStd.StatusCode Case "V" Message = "Address Standardized (DPV)" strStatusCode = "V" strCBSCode = "S1" Case "9" Message = "Address Standardized (Zip4)" strStatusCode = "9" strCBSCode = "S2" Case "7" Message = "Address Standardized (Zip)" strStatusCode = "7" strCBSCode = "S3" Case "5" Message = "Address Standardized (Zip)" strStatusCode = "5" strCBSCode = "S4" Case "X", "S", "E" Select Case AddStd.ErrorCode Case "M" Message = "Multiple Address Matches" strCBSCode = "E1" Case "R" Message = "Address Range Errof" strCBSCode = "E2" Case "T" Message = "Address Component Mismatch" strCBSCode = "E3" Case "N", "U" Message = "Unknown Street" strCBSCode = "E4" Case "X" Message = "Non-Deliverable Address" strCBSCode = "E5" Case "Z" Message = "Zip Code Error" strCBSCode = "E6" Case "D", "" Message = "System Error - Contact Administrator" strCBSCode = "XX" End Select Case Else Message = "Cannot Access Database" End Select End If %>

<% End If End If End If %>
 Standardized

 

<%=strStatusCode%> - <%=Message%> 
Address <%=strAddress%> 
Apt or Suite <%=strAddress2%><%=strSuite%> 
City <%=strCity%> 
State <%=strState%> 
Zip Code <%=strZip%> 
Plus Four <%=strPlus4%> 
Address Type <%=strAddressTypeCode%><%=strAddressTypeString%><%=ZipTypeMessage%>
Carrier Route <%=strCarrierRoute%> 
Delivery Point <%=strDeliveryPointCode%><%=strDeliveryPointCheckDigit%> 
County (FIPS Code) <%=strCountyName%> (<%=strCountyFips%>)
MSA Code <%=strMsa%> 
PMSA Code <%=strPmsa%> 
Time Zone (Code) <%=strTimeZone%> (<%=strTimeZoneCode%>)
Congressional Dist <%=strCongressionalDistrict%> 
Latitude <%=strLatitude%> 
Longitude <%=strLongitude%> 
Primary Area Code <%=strAreaCode%> 
 
Distance to Cypress <%=CompDistance%> 

Cypress Business Solutions, LLC
PO Box 1637
Woodstock, GA 30188
Ph 678.494.9353 | Fax 678.494.9354
www.cypressesolutions.com