% ' Start ASP code here before the HTML. Its always better to do as much ASP stuff before any output. ' First of all, include a simple file which contains some variable values. %> <% ' Now some values have been set we can use them to connect to the Access database ' First, build a SQL query to get the data we want. sql = "Select placeText, placeID from tblPlaces order by placeText ASC" ' Now create a record set to hold the data. "conString" is the connection string and is a variable which has it's ' value set in the include "vars.htm" file on line . ' Line 20 opens the recordset which I've imaginatively called "rsContent". rs being Record Set obviously ;} set rsContent = Server.CreateObject("ADODB.Recordset") rsContent.ActiveConnection = conString rsContent.Source = sql rsContent.CursorType = 3 rsContent.CursorLocation = 2 rsContent.LockType = 1 rsContent.Open() ' Now we have some data from the data base, we need to output it to screen. ' First, get the basic HTML stuff out of the way %>
<%
' Now we have to cheat a bit because the coords are so specific its trickey to generate
' these links dynamically.
' One solution would be to place the COORDS into the database recrod but that would 
' require Peter to enter the correct numbers. Its best not to rely upon users ;}
' SO.... We cheat and hard code the links with the right IDs here.
' This is "not a good thing" generally but there's no way around it
' The ID can be found by either looking in the database or, more simply,
' hovering over the links generated above. For example, The Africa link is
' showPlaces.htm?id=4 which you can see in the status bar when you hover over it.
%>