I have the following code on many pages in my website with some unusual issues.
The code works fine on my local IIS 5.1 on Windows XP Pro. I moved the code to my ISP and the following issues occurred:
1) The database does not work - I received the following error
error '80020009'
/1963-telecaster/pickups/63-tele-pickups.asp, line 147
(I marked line 147 below)
I have set all the permissions on the db file on the server.
2) The page, for some reason the code on the ISP server calls the header 2 and 3 times and the footer twice - for the life of me I cannot figure out why?
Please help?
<%@language="vbscript"%>
<%
set RF = Request.Form
set RQ = Request.QueryString
DIM image_num, tele_page
DIM section, menu_test, menu_path
DIM x, EndTR, StartTR
DIM strSQL ' String variable for building our query
REM ******************************************************************
REM ** Set all local variables to 0
REM *****************************************************************
tele_page = 0
image_num = 0
section = 0
x = 0
EndTR = 0 'End Table Rule Tag </TR> tag
StartTR = 0 ' Start Table Rule Tag <TR>
strSQL = 0
REM ***********************************************************
REM **** Set the page type for the menu and header ***
tele_page = "pickups"
REM ***********************************************************
REM ******* C O N N E C T T O D A T A B A S E ***********************
DATA_SOURCE = "DBQ=" & Server.MapPath("../63-tele-data/Tele_DB.mdb") & ";DRIVER={Microsoft Access Driver (*.mdb)};"
Set DataConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
DataConn.Open DATA_SOURCE
RS.CursorType = adOpenKeyset
%>
<!-- #include file="../include-files/gallery-section.asp" -->
<%
REM ** section variable from gallery-section.asp above
menu_section = section
'Set RS = DataConn.Execute("SELECT * FROM Picture_View where section_name = '" & menu_section &"'") 'WORKS 7/19/06 - WORKS
strSQL = "SELECT * FROM Picture_View where section_name = '" & menu_section &"'"
Set RS=DataConn.Execute(strSQL)
%>
<!doctype html public "-//w3c//dtd html 4.01 transitional//en">
<html>
<head>
<title>
Building a 1963 Telecaster - Fender Custom Shop Texas Special Pickups
</title>
<link rel="stylesheet" href="../include-files/tele-thumbs-gallery.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>
</head>
<!-- #include file="header-pickups.html" -->
<!--**** start preload rollover images - includes <body> tag ****-->
<!-- #include file="../include-files/menu-rollover-preload.asp" -->
<!--**** end preload rollover images ****-->
<table name="outer outer table" border="0" bgcolor="#ffffff" cellpadding="0" cellspacing="0" width="100%">
<tr align="left" valign="top">
<td width="200">
<!--**** table contains menu - main top table - thumbnail table *** -->
<table border="0" cellpadding="0" cellspacing="0" width="840" height="90%">
<tr align="left" valign="top">
<td bgcolor="#ffffff" height="90%" width="147">
<table name="menu table" border="0" cellpadding="0" cellspacing="0" width="143" height="196">
<!--**** start menu buttons display *** -->
<!-- #include file ="../include-files/tele-menu.asp" -->
<!--**** end menu buttons display *** -->
</table name="menu table">
</td>
<!-- *** this table data element forms the vertical line -->
<!-- *** separating the menu from the main table -->
<td bgcolor="#000099" width="1">
<img height="1" src="../images-tele/clear.gif" width="1"></td>
<td height="3" bgcolor="#455d9d">
<!-- main center table containing the thumbnails -->
<table name="main center table" id="thumbnailpagetitle" bgcolor="#455d9d" cellpadding="1" cellspacing="0" width="100%">
<tr valign="top">
<td bgcolor="#455d9d">
Building a 1963 Vintage Lake Placid Blue Telecaster - Fender Custom Shop Telecaster Texas Special Pickups
<br>
<font size="3">Click on each image below for a larger view.</font>
</td>
</tr>
</table>
<!-- ************************************************************* -->
<div id='divwg'>
<table id='thumbnailtext' cellpadding="0" cellspacing="10" border="0">
<tr>
<td colspan='3'>
<div id='linkhome'>
<a href='../63-tele-index.asp'>
Building a 1963 Lake Placid Telecaster - Home </a>
</div><br>
<table cellpadding=0 cellspacing="6" border=0 width="100%">
</table>
</td>
</tr>
<!-- *********************************************************************-->
<%
x = 0
EndTR = 0
StartTR = 3
For x = 100 to 103 'There are 4 images for Pickups
If StartTR = 3 Then
%>
<tr>
<%
StartTR = 0
End If
EndTR = EndTR + 1
%>
<td class='tdImg'>
<a href='../63-tele-picture-view.asp?section=<%=section%>&image_file=<%=x%>-Pickups.JPG'>
<span id='ThumbImage'>
<img src="../images-tele/<%=section%>/<%=section%>-thumbs/<%=x%>-Pickups.JPG" alt="<%=x%>-Pickups.JPG" class="ThumbBorder"></span>
</a><br>
LINE-147 <% If RS("picture_num") = x then
Response.Write RS("short_text")
End If %>
<br><HR>
Image: <%=RS("picture_num")%>-Pickups.JPG
</td>
<%
If EndTR = 3 Then
%>
</tr>
<%
End If
StartTR = StartTR + 1
RS.MoveNext
Next
%>
<!-- **************************************************************** -->
</table> </div>
</table>
</td>
</tr>
</table>
</td>
</tr>
<div id='divWG'>
<!-- #include file ="../include-files/footer-63-tele.asp" -->
</div>
</table>
<!-- file ="../include-files/close-database-include.asp" -->
</body>
</html>