Skip To Main Content | Home | Sitemap | Contact
Latest Visitors: United States's flagUnited States's flagUnited States's flagRussian Federation's flagUnited States's flagUnited States's flagUnited States's flagUnited States's flagUnited States's flagUnited States's flagChina's flagChina's flagUnited States's flagBrazil's flagIreland's flagIndia's flagUnited States's flagUnited Kingdom's flagGermany's flagUnited States's flagCanada's flagCanada's flagUnited States's flagBrazil's flagSweden's flag
 

How can you click a map to query a database?

When you click on the map you will see it returns an example SELECT SQL command with a parameter. Here I just show how to generate the parameters. There are many database access examples on the site if you need help connecting to a database, passing a parameter and returning information, such as this example.

Click the Map, please.
Click for the northwest region. Click for the northeast region. Click for the southeast region. Click for the southwest region. An imagemap of Alberta, Canada


<%
Option Explicit
Session.CodePage=65001
Response.Charset="UTF-8"

Dim area, SQL
area = request.querystring("area")
if area="" then
  SQL = "Click the Map, please."
else
  SQL = "Select * from builders where (area = " & chr(34) & area & chr(34) & ")"
end if 
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="author" content="Roderick Divilbiss">
<meta name="copyright" content="© 2005-2010 Roderick Divilbiss">
<title>Image Map Alberta</title>
<style type="text/css">
<!--
#main {
    width:600px;
    margin-left:auto;
    margin-right:auto;
}
-->
</style>
</head>

<body>
<map name="myImageMap">
  <area href="albertaMap.asp?area=nw" alt="Click for the northwest region." shape="poly" coords="149, 11, 37, 4, 13, 278, 153, 279">
  <area href="albertaMap.asp?area=ne" alt="Click for the northeast region." shape="poly" coords="149, 12, 153, 278, 283, 281, 267, 5">
  <area href="albertaMap.asp?area=se" alt="Click for the southeast region." shape="poly" coords="153, 280, 152, 516, 298, 517, 285, 281">
  <area href="albertaMap.asp?area=sw" alt="Click for the southwest region." shape="poly" coords="11, 280, 152, 282, 151, 516">
</map><img alt="An imagemap of Alberta, Canada" src="images/albert1.gif" width="300" usemap="#myImageMap">
</body>

</html>
  


This Weeks Most Popular Pages Newest Pages