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>

Error 80020009 could be any of these can you be more specific please.

http://www.aspfaq.com/show.asp?id=2421

Also please use [ CODE] my code [ /CODE] tags around your code in posts so we can read it more easily.

DATA_SOURCE = "DBQ=" & Server.MapPath("../63-tele-data/Tele_DB.mdb") & ";DRIVER={Microsoft Access Driver (*.mdb)};"

1. your connection string belongs in Global.asa as an application variable.
2. The above will mean you dont have to use a parent path "../63-tele-data/Tele_DB.mdb" which is disabled with most ISP's due to it being vulnerable to attack.

Also your connection string is ODBC, I'd recommend OLE DB try this instead;

DATA_SOURCE = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/63-tele-data/Tele_DB.mdb") & ";"

Error 80020009 could be any of these can you be more specific please.

http://www.aspfaq.com/show.asp?id=2421

Also please use [ CODE] my code [ /CODE] tags around your code in posts so we can read it more easily.

DATA_SOURCE = "DBQ=" & Server.MapPath("../63-tele-data/Tele_DB.mdb") & ";DRIVER={Microsoft Access Driver (*.mdb)};"

1. your connection string belongs in Global.asa as an application variable.
2. The above will mean you dont have to use a parent path "../63-tele-data/Tele_DB.mdb" which is disabled with most ISP's due to it being vulnerable to attack.

Also your connection string is ODBC, I'd recommend OLE DB try this instead;

DATA_SOURCE = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/63-tele-data/Tele_DB.mdb") & ";"

Thanks for the quick reply and help on protocol for future posts (this was my first one.) The error that I recieved was simply:

"error '80020009'
/1963-telecaster/pickups/63-tele-pickups.asp, line 147"

I understand the 80020009 excetion error could be one of many ut the server did not provide any specific information. The error appeared below an image - the image did not appear either - just the ALT text. (See attached screenshots).

I will try your suggestions

Thanks for the quick reply and help on protocol for future posts (this was my first one.) The error that I recieved was simply:

"error '80020009'
/1963-telecaster/pickups/63-tele-pickups.asp, line 147"

I can see from your screen shot the error is being caught, you must have some 'on error goto' statement ? but not all of the error objects properties are being Response.Write(n) to the page.

Holly,

Thanks again for the quick reply. I thought it's probably easiest to give you the URL that bombs - http://www.higgydude.com/1963-telecaster/pickups/63-tele-pickups.asp. You can see the error that is thrown from the database. I do not have any type of error trapping/catch statements ('on error goto' statement ) that you refer to.

You can see the 3 headers - 1st has image missing, 2nd is the correct header and the 3rd is a generic placeholder I was using. Ironically the Placeholder header file I have removed from the server - yet somehow it is still getting called. The footer gets called twice on the home page - for some reason the footer is not appearing on the section pages (probably because the page dies afer the ASP/DB error??)

I do appreciate your help for this self-taught "hack-wanna-be"

Did you get it working ? the link seems ok now.

Did you put your connection string in Global.asa and get rid of the parent paths? or was it something else ?

I used to have a gorgeous Gordon Smith (Les Paul look alike) with rosewood neck, jumbo frets and twin humbuckers, sigh... I miss her .

Did you get it working ? the link seems ok now.

Did you put your connection string in Global.asa and get rid of the parent paths? or was it something else ?

I used to have a gorgeous Gordon Smith (Les Paul look alike) with rosewood neck, jumbo frets and twin humbuckers, sigh... I miss her .

Holly,

I did put the connection string in the global.asa file. All seems to be working now except for the odditiy of 2 footers and 2 or 3 headers appearing. This one has me totaly stumped. It is as if the code is calling the include files (I used includes for the header and footer) multiple times...arrrgghhh. More digging into the code...but that takes away from playing and building time.

Just out of curiosity what did you think of the info on the site (at least the parts that worked)?

I thought it was very informative yes. One thing the accompanying text for the images is a little small, when you click an image to view it larger, I think you should include the text as well, also larger.

I'm Googling about include files being called twice. I presume you havn't pasted <!-- include blah. into footer.asp as well? it's the obvious culprit I hesitate to mention it because I presume you already checked that.

Holly,

Looks like I fixed the footer issue. I had to remind myself that computers only do what they are told - it was a mistake in my footer code. Now the extra header thing is still bewildering me...

But I did learn something new - I did not know about Gordon Smith guitars. Did some web research - sounds like you had a great instrument.

Thanks for your help. Us "old guys learning new tricks" appreciate it.

Now the extra header thing is still bewildering me...

What extra header ?

I notice when I view the page source that you have no opening body tag.

Thanks for your help. Us "old guys learning new tricks" appreciate it.

Hey no problem we've all been there.

sounds like you had a great instrument.

Sigh... there wasn't a sound or effect she couldn't pull off from country twang to grunge metal!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.