Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image Map and database with case statement 2

Status
Not open for further replies.

MstrMitch

Programmer
Oct 23, 2000
10
0
0
US
I have an htm page that has an image map on it. I want to be able to click onto part of the image and bring up specific parts of a database.
ie: I click on North America in the map, and all the north america records come up. I have made the image map, the database and the asp page that brings the records up for all the records. in the database the location is called "location" and the region is called "area" the location would be the record set of all the locations in the region, the region being "na" for North America, "sa" for South America etc.

I need to know:

how to select one region, and get only that regions records up.

I am sure this is done using a case statement however My knowledge is limited in ASP so please be specific in an explaination. if you give a sample for just north america I can do the rest of them by myself. please help me :)

Mitch
Phoenix, AZ [sig][/sig]
 
In your image map, set the URL with querystrings:
eg.
Code:
[URL unfurl="true"]http://mydomain.com/showrecs.asp?area=na[/URL]

In your recordset page (showrecs.asp in this example), you can do the following:
Code:
dim region
region = Request.QueryString("area")

dim oRs, strSQL
set oRs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT location FROM LOC_DB WHERE area = '" & _
  region & "';"
oRs.Open strSQL, db
...
This way, you don't even need case statements. :)

HTH

Choo Khor
choo.khor@intelebill.com
 
thanks for your help, it worked beautifully :)

Mitch
Phoenix, AZ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top