<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% '=============================================================================== ' If use SQL Server add the Internet Guest Account on your Security/Logins Panel ' and then set it as db_datareader for the database ITAliA. ' ' set dbType = 0 if is Access 2000 or higher or = 1 if is SQL Server 2000 '=============================================================================== dbType = 0 sbSqlServer = "localhost" dbSqlCatalog = "ITALIA" AccessDBPath = "\mdb-database\ITALIA\ITALIA.mdb" function idParentPath(valueID, byRef outArray) query = "SELECT parentID FROM tblObjects WHERE objectID = " & valueID set recordset = conn.execute(query) if not recordset.eof then parentValueID = recordset("parentID") outArray = outArray & parentValueID if not parentValueID = 0 then outArray = outArray & " " idParentPath parentValueID, outArray end if end if end function objectID = request.queryString("ID") regioneID = 0 provinciaID = 0 comuneID = 0 ricerca = request.form("ricerca") stringRicerca = server.HTMLEncode(ricerca) thisPage = request.serverVariables("PATH_INFO") set conn = server.createObject("ADODB.Connection") if dbType = 0 then conn.open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& server.mapPath(AccessDBPath) elseIf dbType = 1 then conn.open "Provider=sqloledb;Data Source=" & dbSqlServer & ";Initial Catalog=" & dbSqlCatalog & ";Integrated Security=SSPI;" end if if len(objectID) > 0 and isNumeric(objectID) then objectID = cLng(objectID): idParentPath objectID, arrID if inStr(arrID," ") > 0 then arrID = split(arrID) if isArray(arrID) then if uBound(arrID) = 2 then comuneID = objectID regioneID = cLng(arrID(1)) provinciaID = cLng(arrID(0)) elseIf uBound(arrID) = 1 then provinciaID = objectID regioneID = cLng(arrID(0)) end if else regioneID = objectID end if %> C.A.P. d'Italia - codici di avviamento postale di tutti i comuni d'Italia.

CAP, C.A.P., codici d'avviamento postale dei comuni d'Italia.

dove sei: home > Codici di avviamento postale

> Codici d'avviamento postale d'Italia

Con questo tool riuscirai ad ottenere velocemente il codice di avviamento postale del Comune che ti interessa.

Seleziona dapprima la regione di appartenenza, quindi il tool ti chiederà di selezionare la provincia ed infine dal menu cerca il comune di tuo interesse.

La procedura ti restituirà rapidamente il relativo C.A.P.

 

Regioni: <% if regioneID > 0 then %> Province : <% end if %> <% if provinciaID > 0 then %>

 

Comuni: <% end if %>

 

 

<% if comuneID > 0 then sql = "SELECT A.objectName AS X, B.objectShortName AS Y, A.objectCode AS Z " &_ "FROM tblObjects A " &_ "INNER JOIN tblObjects B " &_ "ON B.objectID = A.parentID " &_ "WHERE A.objectID = " & comuneID set rs = conn.execute(sql) if not rs.eof then %> Comune:<%=rs("X")%>(<%=rs("Y")%>)-CAP:<%=rs("Z")%> <% end if rs.close set rs = nothing end if %> <% if len(message) > 0 then response.write message %>

<% conn.close set conn = nothing %>