View Single Post
Old 03-15-2013, 08:02 PM   PM User | #8
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Okay, try this replacement. (I truly *HATE* DreamWeaver code. I cleaned up a lot of it, but not all. But enough to make this somewhat more efficient, at least. The stuff in red is the important part. Other changes not as important, but they will make your code more efficient if you use them.)
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/Landmarks.asp" -->
<%
' the code I had suggested:
parts = Split( Trim( Request("landname") ), "$$" )
id = CLNG(parts(0))
landmark = parts(1)

Set conn = Server.CreateObject ("ADODB.Connection")
conn.Open MM_Landmarks_STRING

SQL1 = "SELECT * FROM dbo.tblLandmark WHERE LandName = '" & Replace(landmark,"'","''") & "'"
Set RSLandmarks = conn.Execute(SQL1)

SQL2 = "SELECT * FROM dbo.tblLandmarkContacts WHERE FromID = " & id
Set RSLandContacts = conn.Execute(SQL2)

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
	background-color: #000;
	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
	color: #0FF;
}
.Fonts {
	font-size: 24px;
}
OtherFonts {
	color: #FF0;
}
.Data2 {
	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #FFF;
	text-align: left;
}
.Fonts2 {
	color: #FF0;
	font-size: 12px;
	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
	text-align: left;
}
.Fonts2Heading {
	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
	color: #FF0;
}
.Fonts table tr td .Fonts2Heading .Fonts2 .Fonts2Heading {
	font-weight: bold;
}
.Data {
	font-size: 12px;
	color: #FFF;
	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
	text-align: left;
}
.Fonts #form1 table {
	text-align: left;
	font-size: 10px;
}
</style>
</head>

<body class="Fonts">
<table width="100%" border="0">
  <tr>
    <td><div align="center">Landmark Info Display</div></td>
  </tr>
</table>
<p>&nbsp;</p>
<form id="form1" name="form1" method="get" action="">
<table width="100%" border="0" align="center">
    <tr>
      <td width="64%"><span class="Fonts2"><%=RSLandmarks("LandName")%></span></td>
    </tr>
    <tr>
      <td class="Data"><span class="Data2"><%=RSLandmarks("StNumber")%> <%=RSLandmarks("Dir")%> &nbsp; <%=RSLandmarks("Address")%></span></td>
    </tr>
    <tr>
      <td class="Data"><span class="Fonts"><span class="Fonts"><span class="Fonts2">CONTACTS</span></span></span></td>
    </tr>
    <tr>
      <td class="Data"><table width="100%" border="0" align="center">
        <tr>
          <td width="32%"><span class="Data2"><%=RSLandmarks("ContactType1")%></span></td>
          <td width="46%"><span class="Data2"><%=RSLandmarks("PrimaryContact")%></span></td>
          <td width="22%"><span class="Data2"><%=RSLandmarks("PrimaryPhone")%></span></td>
          </tr>
        <tr>
          <td><span class="Data2"><%=RSLandmarks("ContactType2")%></span></td>
          <td><span class="Data2"><%=RSLandmarks("Contact2")%></span></td>
          <td><span class="Data2"><%=RSLandmarks("Phone2")%></span></td>
          </tr>
        <tr>
          <td><%=RSLandContacts("ContactType")%></td>
          <td><%=RSLandContacts("ConName")%></td>
          <td><%=RSLandContacts("Phone")%></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td class="Data">&nbsp;</td>
    </tr>
  </table>
</form>
<p class="Fonts2">&nbsp;</p>
<p class="Fonts2">&nbsp;</p>
</body>
</html>
<%
RSLandmarks.Close()
RSLandContacts.Close()
conn.Close
%>
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote