Forums

This topic is locked

Classic ASP Paging Error!!!!!! Pl help me

Posted 28 Mar 2008 21:20:09
1
has voted
28 Mar 2008 21:20:09 phyu aung posted:
I write these two asp pages with micromedia dreamweaver 8.
I got the ASP paging error!!!


<b> Error type!!!! "ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. "</b>

Index.asp
////////////

&lt;%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%&gt;
&lt;%

// *** Logout the current user.
MM_Logout = String(Request.ServerVariables("URL") + "?MM_Logoutnow=1";
if (String(Request("MM_Logoutnow")=="1" {
Session.Contents.Remove("MM_Username";
Session.Contents.Remove("MM_UserAuthorization";
var MM_logoutRedirectPage = "Thankyou.asp";
// redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage == "" MM_logoutRedirectPage = String(Request.ServerVariables("URL");
if (String(MM_logoutRedirectPage).indexOf("?" == -1 && Request.QueryString != "" {
var MM_newQS = "?";
for (var items=new Enumerator(Request.QueryString); !items.atEnd(); items.moveNext()) {
if (String(items.item()) != "MM_Logoutnow" {
if (MM_newQS.length &gt; 1) MM_newQS += "&";
MM_newQS += items.item() + "=" + Server.URLencode(Request.QueryString(items.item()));
}
}
if (MM_newQS.length &gt; 1) MM_logoutRedirectPage += MM_newQS;
}
Response.Redirect(MM_logoutRedirectPage);
}
%&gt;
&lt;!--#include file="Connections/WatchGallery.asp" --&gt;
&lt;!--#include file="Connections/WatchGallery.asp" --&gt;
&lt;%
var Recordset1 = Server.CreateObject("ADODB.Recordset";
Recordset1.ActiveConnection = MM_WatchGallery_STRING;
Recordset1.Source = "SELECT wrefno, wname, price, brandid FROM WatchInfo";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%&gt;
&lt;%
var Recordset2 = Server.CreateObject("ADODB.Recordset";
Recordset2.ActiveConnection = MM_WatchGallery_STRING;
Recordset2.Source = "SELECT * FROM BrandInfo";
Recordset2.CursorType = 0;
Recordset2.CursorLocation = 2;
Recordset2.LockType = 1;
Recordset2.Open();
var Recordset2_numRows = 0;
%&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;script language="javascript" &gt;var imageclock=new Object()
//Enter path to clock digit images here, in order of 0-9, then "am/pm", then colon image:
imageclock.digits=["clockimages/c0.gif", "clockimages/c1.gif", "clockimages/c2.gif", "clockimages/c3.gif", "clockimages/c4.gif", "clockimages/c5.gif", "clockimages/c6.gif", "clockimages/c7.gif", "clockimages/c8.gif", "clockimages/c9.gif", "clockimages/cam.gif", "clockimages/cpm.gif", "clockimages/colon.gif"]
imageclock.instances=0
var preloadimages=[]
for (var i=0; i&lt;imageclock.digits.length; i++){ //preload images
preloadimages[i]=new Image()
preloadimages[i].src=imageclock.digits[i]
}

imageclock.imageHTML=function(timestring){ //return timestring (ie: 1:56:38) into string of images instead
var sections=timestring.split(":"
if (sections[0]=="0" //If hour field is 0 (aka 12 AM)
sections[0]="12"
else if (sections[0]&gt;=13)
sections[0]=sections[0]-12+""
for (var i=0; i&lt;sections.length; i++){
if (sections[i].length==1)
sections[i]='&lt;img src="'+imageclock.digits[0]+'" /&gt;'+'&lt;img src="'+imageclock.digits[parseInt(sections[i])]+'" /&gt;'
else
sections[i]='&lt;img src="'+imageclock.digits[parseInt(sections[i].charAt(0))]+'" /&gt;'+'&lt;img src="'+imageclock.digits[parseInt(sections[i].charAt(1))]+'" /&gt;'
}
return sections[0]+'&lt;img src="'+imageclock.digits[12]+'" /&gt;'+sections[1]+'&lt;img src="'+imageclock.digits[12]+'" /&gt;'+sections[2]
}

imageclock.display=function(){
var clockinstance=this
this.spanid="clockspan"+(imageclock.instances++)
document.write('&lt;span id="'+this.spanid+'"&gt;&lt;/span&gt;')
this.update()
setInterval(function(){clockinstance.update()}, 1000)
}

imageclock.display.prototype.update=function(){
var dateobj=new Date()
var currenttime=dateobj.getHours()+":"+dateobj.getMinutes()+":"+dateobj.getSeconds() //create time string
var currenttimeHTML=imageclock.imageHTML(currenttime)+'&lt;img src="'+((dateobj.getHours()&gt;=12)? imageclock.digits[11] : imageclock.digits[10])+'" /&gt;'
document.getElementById(this.spanid).innerHTML=currenttimeHTML

}
&lt;/script&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Watch Gallery&lt;/title&gt;
&lt;link rel="stylesheet" href="css/global.css" type="text/css" /&gt;
&lt;/head&gt;
&lt;body&gt;


&lt;table align="center" width="800" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td height="20"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="images/homebanner.jpg" width="800" height="120" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;div id="menu"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="Index.asp"&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="SiteMap.asp"&gt;Site Map&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="Company.asp"&gt;The Company &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="Watches.asp"&gt;Watches&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="Information.asp"&gt;Infromation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="Login.asp"&gt;Log In &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="Contact.asp"&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt; &lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td&gt;
&lt;table width="800" border="1" cellspacing="0" cellpadding="0" bgcolor="#FBFBFB"&gt;
&lt;tr&gt;
&lt;td bgcolor="#000033" valign="top" align="center"&gt; &lt;script language="javascript"&gt;new imageclock.display()&lt;/script&gt;&lt;/td&gt;
&lt;td bgcolor="#000033" valign="top"&gt;&lt;h3 align="right"&gt;&lt;a href="&lt;%= MM_Logout %&gt;"&gt;Log out&lt;/a&gt; &lt;/h3&gt; &lt;/tr&gt;
&lt;tr&gt;
&lt;td width="158" valign="top"&gt;
&lt;form name="form1" id="form1" method="post" action="SearchCheck.asp"&gt;
&lt;table width="200" border="0"&gt;
&lt;tr&gt;
&lt;td colspan="2" bgcolor="#CCCCCC" height="20"&gt;&lt;div align="center"&gt;&lt;strong&gt;Watch Search&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="70"&gt;&lt;div align="right"&gt;Make:&lt;/div&gt;&lt;/td&gt;
&lt;td width="94"&gt;&lt;select name="MDropList"&gt;
&lt;%
while (!Recordset2.EOF) {
%&gt;&lt;option value="&lt;%=(Recordset2.Fields.Item("brandid".Value)%&gt;"&gt;&lt;%=(Recordset2.Fields.Item("brandname".Value)%&gt;&lt;/option&gt;&lt;%
Recordset2.MoveNext();
}
if (Recordset2.CursorType &gt; 0) {
if (!Recordset2.BOF) Recordset2.MoveFirst();
} else {
Recordset2.Requery();
}
%&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;Gender:&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;select name="GDropList" id="GDropList" tabindex="2" onkeydown="if (window.event.keyCode==13){document.form1.submit();}"&gt;
&lt;option value="1"&gt;Either&lt;/option&gt;
&lt;option value="2"&gt;Men&lt;/option&gt;
&lt;option value="3"&gt;Ladies&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&lt;input name="Submit" type="submit" id="Submit" value="Search" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;


&lt;form name="specform1" id="specform1" method="post" action="Detail.asp"&gt;
&lt;table width="200" border="0"&gt;
&lt;tr&gt;
&lt;td height="20" bgcolor="#CCCCCC"&gt;&lt;div align="center"&gt;&lt;strong&gt;Special Offer &lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="Images/CA003s.jpg" width="200" height="200" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;Cartier &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;&lt;reflabel&gt;CA003&lt;/reflabel&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;Men's Francaise Watch &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;S$ 3492 &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;
&lt;input type="submit" name="Submit" value="Info" /&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;hr width="200"/&gt;
&lt;form name="specform2" id="specform2" method="post" action="Detail.asp"&gt;
&lt;table width="200" border="0"&gt;
&lt;tr&gt;
&lt;td height="210"&gt;&lt;img src="Images/SW003s.jpg" width="200" height="200" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;Swatch&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;&lt;reflabel&gt;SW003&lt;/reflabel&gt;

&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;LULUDIA&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt; S$ 105 &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;
&lt;input type="submit" name="Submit" value="Info" /&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;&lt;/td&gt;
&lt;td width="636" valign="top"&gt;

&lt;form action="SearchCheck.asp" method="post" id="watchesform" name="watchesform"&gt;
&lt;table width="591" border="0"&gt;
&lt;tr&gt;
&lt;td colspan="4" bgcolor="#CCCCCC" height="20"&gt;&lt;strong&gt;Available Watches&lt;/strong&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="138"&gt;&lt;div align="center"&gt;&lt;img src="Images/Omega.jpg" width="68" height="90" longdesc="Images/Omega.jpg" /&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="143"&gt;&lt;div align="center"&gt;&lt;img src="Images/Guess.jpg" width="58" height="90" longdesc="Images/Guess.jpg" /&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="128"&gt;&lt;div align="center"&gt;&lt;img src="Images/Cartier.jpg" width="69" height="82" longdesc="Images/Cartier.jpg" /&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="163"&gt;&lt;div align="center"&gt;&lt;img src="Images/Swatch.jpg" width="62" height="90" longdesc="Images/Swatch.jpg" /&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;&lt;label&gt;&lt;a href="SearchCheck.asp"&gt;Omega&lt;/a&gt;&lt;/label&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;div align="center"&gt;&lt;label&gt;&lt;a href="SearchCheck.asp"&gt;Guess&lt;/a&gt;&lt;/label&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;div align="center"&gt;&lt;label&gt;&lt;/label&gt;
&lt;label&gt;&lt;a href="SearchCheck.asp"&gt;Cartier&lt;/a&gt;&lt;/label&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;div align="center"&gt;&lt;label&gt;&lt;a href="SearchCheck.asp"&gt;Swatch&lt;/a&gt;&lt;/label&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;hr width="590"/&gt; &lt;/tr&gt;
&lt;/table&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="3"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="30" bgcolor="#000033" align="center"&gt;&lt;font color="#FFFFFF"&gt;WatchGallery@2008&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
Recordset1.Close();
%&gt;
&lt;%
Recordset2.Close();
%&gt;





////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

SearchCheck.asp


&lt;%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%&gt;
&lt;%

// *** Logout the current user.
MM_Logout = String(Request.ServerVariables("URL") + "?MM_Logoutnow=1";
if (String(Request("MM_Logoutnow")=="1" {
Session.Contents.Remove("MM_Username";
Session.Contents.Remove("MM_UserAuthorization";
var MM_logoutRedirectPage = "Thankyou.asp";
// redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage == "" MM_logoutRedirectPage = String(Request.ServerVariables("URL");
if (String(MM_logoutRedirectPage).indexOf("?" == -1 && Request.QueryString != "" {
var MM_newQS = "?";
for (var items=new Enumerator(Request.QueryString); !items.atEnd(); items.moveNext()) {
if (String(items.item()) != "MM_Logoutnow" {
if (MM_newQS.length &gt; 1) MM_newQS += "&";
MM_newQS += items.item() + "=" + Server.URLencode(Request.QueryString(items.item()));
}
}
if (MM_newQS.length &gt; 1) MM_logoutRedirectPage += MM_newQS;
}
Response.Redirect(MM_logoutRedirectPage);
}
%&gt;
&lt;!--#include file="Connections/WatchGallery.asp" --&gt;
&lt;!--#include file="Connections/WatchGallery.asp" --&gt;
&lt;%
var Recordset1 = Server.CreateObject("ADODB.Recordset";
Recordset1.ActiveConnection = MM_WatchGallery_STRING;
Recordset1.Source = "SELECT wrefno, wname, price, brandid FROM WatchInfo";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%&gt;
&lt;%
var Recordset2 = Server.CreateObject("ADODB.Recordset";
Recordset2.ActiveConnection = MM_WatchGallery_STRING;
Recordset2.Source = "SELECT * FROM BrandInfo";
Recordset2.CursorType = 0;
Recordset2.CursorLocation = 2;
Recordset2.LockType = 1;
Recordset2.Open();
var Recordset2_numRows = 0;
%&gt;
&lt;%
var Recordset3 = Server.CreateObject("ADODB.Recordset";
var bdid
Recordset3.ActiveConnection = MM_WatchGallery_STRING;
bid= String (Request.Form("MDropList");
Recordset3.Source = "SELECT * FROM BrandInfo WHERE brandid='"+bid+"'";
Recordset3.CursorType = 0;
Recordset3.CursorLocation = 2;
Recordset3.LockType = 1;
Recordset3.Open();
var Recordset3_numRows = 0;
%&gt;
&lt;%
var Recordset4 = Server.CreateObject("ADODB.Recordset";
var Make, Gender;
Recordset4.ActiveConnection = MM_WatchGallery_STRING;

Make= String (Request.Form("MDropList");
Gender= String (Request.Form("GDropList");

if (Gender=="1"
{ Recordset4.Source = "SELECT * FROM WatchInfo WHERE brandid = '"+Make+"'";}
else if (Gender=="2"
{ Recordset4.Source = "SELECT * FROM WatchInfo WHERE brandid = '"+Make+"' and gender='Men'";}
else
{ Recordset4.Source = "SELECT * FROM WatchInfo WHERE brandid = '"+Make+"' and gender='Ladies'";}

Recordset4.CursorType = 0;
Recordset4.CursorLocation = 2;
Recordset4.LockType = 1;
Recordset4.Open();
var Recordset4_numRows = 0;
%&gt;
&lt;%
var Repeat1__numRows = 2;
var Repeat1__index = 0;
Recordset4_numRows += Repeat1__numRows;
%&gt;
&lt;%
// *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

// set the record count
var Recordset4_total = Recordset4.RecordCount;

// set the number of rows displayed on this page
if (Recordset4_numRows &lt; 0) { // if repeat region set to all records
Recordset4_numRows = Recordset4_total;
} else if (Recordset4_numRows == 0) { // if no repeat regions
Recordset4_numRows = 1;
}

// set the first and last displayed record
var Recordset4_first = 1;
var Recordset4_last = Recordset4_first + Recordset4_numRows - 1;

// if we have the correct record count, check the other stats
if (Recordset4_total != -1) {
Recordset4_numRows = Math.min(Recordset4_numRows, Recordset4_total);
Recordset4_first = Math.min(Recordset4_first, Recordset4_total);
Recordset4_last = Math.min(Recordset4_last, Recordset4_total);
}
%&gt;
&lt;% var MM_paramName = ""; %&gt;
&lt;%
// *** Move To Record and Go To Record: declare variables

var MM_rs = Recordset4;
var MM_rsCount = Recordset4_total;
var MM_size = Recordset4_numRows;
var MM_uniqueCol = "";
MM_paramName = "";
var MM_offset = 0;
var MM_atTotal = false;
var MM_paramIsDefined = (MM_paramName != "" && String(Request(MM_paramName)) != "undefined";
%&gt;
&lt;%
// *** Move To Record: handle 'index' or 'offset' parameter

if (!MM_paramIsDefined && MM_rsCount != 0) {

// use index parameter if defined, otherwise use offset parameter
r = String(Request("index");
if (r == "undefined" r = String(Request("offset");
if (r && r != "undefined" MM_offset = parseInt(r);

// if we have a record count, check if we are past the end of the recordset
if (MM_rsCount != -1) {
if (MM_offset &gt;= MM_rsCount || MM_offset == -1) { // past end or move last
if ((MM_rsCount % MM_size) != 0) { // last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount % MM_size);
} else {
MM_offset = MM_rsCount - MM_size;
}
}
}

// move the cursor to the selected record
for (var i=0; !MM_rs.EOF && (i &lt; MM_offset || MM_offset == -1); i++) {
MM_rs.MoveNext();
}
if (MM_rs.EOF) MM_offset = i; // set MM_offset to the last possible record
}
%&gt;
&lt;%
// *** Move To Record: if we dont know the record count, check the display range

if (MM_rsCount == -1) {

// walk to the end of the display range for this page
for (var i=MM_offset; !MM_rs.EOF && (MM_size &lt; 0 || i &lt; MM_offset + MM_size); i++) {
MM_rs.MoveNext();
}

// if we walked off the end of the recordset, set MM_rsCount and MM_size
if (MM_rs.EOF) {
MM_rsCount = i;
if (MM_size &lt; 0 || MM_size &gt; MM_rsCount) MM_size = MM_rsCount;
}

// if we walked off the end, set the offset based on page size
if (MM_rs.EOF && !MM_paramIsDefined) {
if ((MM_rsCount % MM_size) != 0) { // last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount % MM_size);
} else {
MM_offset = MM_rsCount - MM_size;
}
}

// reset the cursor to the beginning
if (MM_rs.CursorType &gt; 0) {
if (!MM_rs.BOF) MM_rs.MoveFirst();
} else {
MM_rs.Requery();
}

// move the cursor to the selected record
for (var i=0; !MM_rs.EOF && i &lt; MM_offset; i++) {
MM_rs.MoveNext();
}
}
%&gt;
&lt;%
// *** Move To Record: update recordset stats

// set the first and last displayed record
Recordset4_first = MM_offset + 1;
Recordset4_last = MM_offset + MM_size;
if (MM_rsCount != -1) {
Recordset4_first = Math.min(Recordset4_first, MM_rsCount);
Recordset4_last = Math.min(Recordset4_last, MM_rsCount);
}

// set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount != -1 && MM_offset + MM_size &gt;= MM_rsCount);
%&gt;
&lt;%
// *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

// create the list of parameters which should not be maintained
var MM_removeList = "&index=";
if (MM_paramName != "" MM_removeList += "&" + MM_paramName.toLowerCase() + "=";
var MM_keepURL="",MM_keepForm="",MM_keepBoth="",MM_keepNone="";

// add the URL parameters to the MM_keepURL string
for (var items=new Enumerator(Request.QueryString); !items.atEnd(); items.moveNext()) {
var nextItem = "&" + items.item().toLowerCase() + "=";
if (MM_removeList.indexOf(nextItem) == -1) {
MM_keepURL += "&" + items.item() + "=" + Server.URLencode(Request.QueryString(items.item()));
}
}

// add the Form variables to the MM_keepForm string
for (var items=new Enumerator(Request.Form); !items.atEnd(); items.moveNext()) {
var nextItem = "&" + items.item().toLowerCase() + "=";
if (MM_removeList.indexOf(nextItem) == -1) {
MM_keepForm += "&" + items.item() + "=" + Server.URLencode(Request.Form(items.item()));
}
}

// create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL + MM_keepForm;
if (MM_keepBoth.length &gt; 0) MM_keepBoth = MM_keepBoth.substring(1);
if (MM_keepURL.length &gt; 0) MM_keepURL = MM_keepURL.substring(1);
if (MM_keepForm.length &gt; 0) MM_keepForm = MM_keepForm.substring(1);
%&gt;
&lt;%
// *** Move To Record: set the strings for the first, last, next, and previous links

var MM_moveFirst="",MM_moveLast="",MM_moveNext="",MM_movePrev="";
var MM_keepMove = MM_keepBoth; // keep both Form and URL parameters for moves
var MM_moveParam = "index";

// if the page has a repeated region, remove 'offset' from the maintained parameters
if (MM_size &gt; 1) {
MM_moveParam = "offset";
if (MM_keepMove.length &gt; 0) {
params = MM_keepMove.split("&";
MM_keepMove = "";
for (var i=0; i &lt; params.length; i++) {
var nextItem = params[i].substring(0,params[i].indexOf("=");
if (nextItem.toLowerCase() != MM_moveParam) {
MM_keepMove += "&" + params[i];
}
}
if (MM_keepMove.length &gt; 0) MM_keepMove = MM_keepMove.substring(1);
}
}

// set the strings for the move to links
if (MM_keepMove.length &gt; 0) MM_keepMove = Server.HTMLEncode(MM_keepMove) + "&";
var urlStr = Request.ServerVariables("URL" + "?" + MM_keepMove + MM_moveParam + "=";
MM_moveFirst = urlStr + "0";
MM_moveLast = urlStr + "-1";
MM_moveNext = urlStr + (MM_offset + MM_size);
MM_movePrev = urlStr + Math.max(MM_offset - MM_size,0);
%&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;script language="javascript" &gt;var imageclock=new Object()
//Enter path to clock digit images here, in order of 0-9, then "am/pm", then colon image:
imageclock.digits=["clockimages/c0.gif", "clockimages/c1.gif", "clockimages/c2.gif", "clockimages/c3.gif", "clockimages/c4.gif", "clockimages/c5.gif", "clockimages/c6.gif", "clockimages/c7.gif", "clockimages/c8.gif", "clockimages/c9.gif", "clockimages/cam.gif", "clockimages/cpm.gif", "clockimages/colon.gif"]
imageclock.instances=0
var preloadimages=[]
for (var i=0; i&lt;imageclock.digits.length; i++){ //preload images
preloadimages[i]=new Image()
preloadimages[i].src=imageclock.digits[i]
}

imageclock.imageHTML=function(timestring){ //return timestring (ie: 1:56:38) into string of images instead
var sections=timestring.split(":"
if (sections[0]=="0" //If hour field is 0 (aka 12 AM)
sections[0]="12"
else if (sections[0]&gt;=13)
sections[0]=sections[0]-12+""
for (var i=0; i&lt;sections.length; i++){
if (sections[i].length==1)
sections[i]='&lt;img src="'+imageclock.digits[0]+'" /&gt;'+'&lt;img src="'+imageclock.digits[parseInt(sections[i])]+'" /&gt;'
else
sections[i]='&lt;img src="'+imageclock.digits[parseInt(sections[i].charAt(0))]+'" /&gt;'+'&lt;img src="'+imageclock.digits[parseInt(sections[i].charAt(1))]+'" /&gt;'
}
return sections[0]+'&lt;img src="'+imageclock.digits[12]+'" /&gt;'+sections[1]+'&lt;img src="'+imageclock.digits[12]+'" /&gt;'+sections[2]
}

imageclock.display=function(){
var clockinstance=this
this.spanid="clockspan"+(imageclock.instances++)
document.write('&lt;span id="'+this.spanid+'"&gt;&lt;/span&gt;')
this.update()
setInterval(function(){clockinstance.update()}, 1000)
}

imageclock.display.prototype.update=function(){
var dateobj=new Date()
var currenttime=dateobj.getHours()+":"+dateobj.getMinutes()+":"+dateobj.getSeconds() //create time string
var currenttimeHTML=imageclock.imageHTML(currenttime)+'&lt;img src="'+((dateobj.getHours()&gt;=12)? imageclock.digits[11] : imageclock.digits[10])+'" /&gt;'
document.getElementById(this.spanid).innerHTML=currenttimeHTML

}
&lt;/script&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Watch Gallery&lt;/title&gt;
&lt;link rel="stylesheet" href="css/global.css" type="text/css" /&gt;
&lt;/head&gt;
&lt;body&gt;


&lt;table align="center" width="800" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td height="20"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="images/homebanner.jpg" width="800" height="120" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;div id="menu"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="Index.asp"&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="SiteMap.asp"&gt;Site Map&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="Company.asp"&gt;The Company &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="Watches.asp"&gt;Watches&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="Information.asp"&gt;Infromation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="Login.asp"&gt;Log In &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="Contact.asp"&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt; &lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td&gt;
&lt;table width="800" border="1" cellspacing="0" cellpadding="0" bgcolor="#FBFBFB"&gt;
&lt;tr&gt;
&lt;td bgcolor="#000033" valign="top" align="center"&gt; &lt;script language="javascript"&gt;new imageclock.display()&lt;/script&gt;&lt;/td&gt;
&lt;td bgcolor="#000033" valign="top"&gt;&lt;h3 align="right"&gt;&lt;a href="&lt;%= MM_Logout %&gt;"&gt;Log out&lt;/a&gt; &lt;/h3&gt; &lt;/tr&gt;
&lt;tr&gt;
&lt;td width="158" valign="top"&gt;
&lt;form name="form1" id="form1" method="post" action="SearchCheck.asp"&gt;
&lt;table width="200" border="0"&gt;
&lt;tr&gt;
&lt;td colspan="2" bgcolor="#CCCCCC" height="20"&gt;&lt;div align="center"&gt;&lt;strong&gt;Watch Search&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="70"&gt;&lt;div align="right"&gt;Make:&lt;/div&gt;&lt;/td&gt;
&lt;td width="94"&gt;&lt;select name="MDropList"&gt;
&lt;%
while (!Recordset2.EOF) {
%&gt;&lt;option value="&lt;%=(Recordset2.Fields.Item("brandid".Value)%&gt;"&gt;&lt;%=(Recordset2.Fields.Item("brandname".Value)%&gt;&lt;/option&gt;&lt;%
Recordset2.MoveNext();
}
if (Recordset2.CursorType &gt; 0) {
if (!Recordset2.BOF) Recordset2.MoveFirst();
} else {
Recordset2.Requery();
}
%&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;Gender:&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;select name="GDropList" id="GDropList" tabindex="2" onkeydown="if (window.event.keyCode==13){document.form1.submit();}"&gt;
&lt;option value="1"&gt;Either&lt;/option&gt;
&lt;option value="2"&gt;Men&lt;/option&gt;
&lt;option value="3"&gt;Ladies&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&lt;input name="Submit" type="submit" id="Submit" value="Search" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;


&lt;form name="specform1" id="specform1" method="post" action="Detail.asp"&gt;
&lt;table width="200" border="0"&gt;
&lt;tr&gt;
&lt;td height="20" bgcolor="#CCCCCC"&gt;&lt;div align="center"&gt;&lt;strong&gt;Special Offer &lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="Images/CA003s.jpg" width="200" height="200" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;Cartier &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;&lt;reflabel&gt;CA003&lt;/reflabel&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;Men's Francaise Watch &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;S$ 3492 &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;
&lt;input type="submit" name="Submit" value="Info" /&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;hr width="200"/&gt;
&lt;form name="specform2" id="specform2" method="post" action="Detail.asp"&gt;
&lt;table width="200" border="0"&gt;
&lt;tr&gt;
&lt;td height="210"&gt;&lt;img src="Images/SW003s.jpg" width="200" height="200" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;Swatch&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;&lt;reflabel&gt;SW003&lt;/reflabel&gt;

&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;LULUDIA&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt; S$ 105 &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;
&lt;input type="submit" name="Submit" value="Info" /&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;&lt;/td&gt;
&lt;td width="636" valign="top"&gt;

&lt;form action="" method="post" id="watchesform" name="watchesform"&gt;
&lt;table width="591" border="0"&gt;
&lt;tr&gt;
&lt;td width="572" height="20" bgcolor="#CCCCCC"&gt;&lt;div align="center"&gt;&lt;h1&gt;Search Result for &lt;%=(Recordset3.Fields.Item("brandname".Value)%&gt;&lt;/h1&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="20"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;/form&gt;

&lt;% while ((Repeat1__numRows-- != 0) && (!Recordset4.EOF)) { %&gt;
&lt;form action="Deatail.asp" method="post" name="SListForm"&gt;
&lt;table width="590" border="1"&gt;
&lt;tr&gt;
&lt;td colspan="3"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;&lt;div align="center"&gt;&lt;%=(Recordset4.Fields.Item("wname".Value)%&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="184" rowspan="7"&gt;&lt;img src="Images/&lt;%=(Recordset4.Fields.Item("smallimage".Value)%&gt;"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;&lt;div align="center"&gt;&lt;%=(Recordset4.Fields.Item("description".Value)%&gt;&lt;/div&gt;
&lt;div align="center"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="164"&gt;&lt;div align="right"&gt; Our Price: &lt;/div&gt;&lt;/td&gt;
&lt;td width="220"&gt;&lt;%=(Recordset4.Fields.Item("price".Value)%&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;Watch Ref no: &lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;%=(Recordset4.Fields.Item("wrefno".Value)%&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;Condition:&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;%=(Recordset4.Fields.Item("condition".Value)%&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;Gender:&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;%=(Recordset4.Fields.Item("gender".Value)%&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;RRP:&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;%=(Recordset4.Fields.Item("rrprice".Value)%&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;Status:&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;%=(Recordset4.Fields.Item("status".Value)%&gt;&lt;/td&gt;
&lt;td&gt;&lt;div align="center"&gt;
&lt;input type="submit" name="Submit2" value="Detail" /&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="3"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;%
Repeat1__index++;
Recordset4.MoveNext();
}
%&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;

&lt;table border="0" width="50%" align="center"&gt;
&lt;tr&gt;
&lt;td width="23%" align="center"&gt;&lt;% if (MM_offset != 0) { %&gt;
&lt;a href="&lt;%=MM_moveFirst%&gt;"&gt;&lt;img src="First.gif" border=0&gt;&lt;/a&gt;
&lt;% } // end MM_offset != 0 %&gt;
&lt;/td&gt;
&lt;td width="31%" align="center"&gt;&lt;% if (MM_offset != 0) { %&gt;
&lt;a href="&lt;%=MM_movePrev%&gt;"&gt;&lt;img src="Previous.gif" border=0&gt;&lt;/a&gt;
&lt;% } // end MM_offset != 0 %&gt;
&lt;/td&gt;
&lt;td width="23%" align="center"&gt;&lt;% if (!MM_atTotal) { %&gt;
&lt;a href="&lt;%=MM_moveNext%&gt;"&gt;&lt;img src="Next.gif" border=0&gt;&lt;/a&gt;
&lt;% } // end !MM_atTotal %&gt;
&lt;/td&gt;
&lt;td width="23%" align="center"&gt;&lt;% if (!MM_atTotal) { %&gt;
&lt;a href="&lt;%=MM_moveLast%&gt;"&gt;&lt;img src="Last.gif" border=0&gt;&lt;/a&gt;
&lt;% } // end !MM_atTotal %&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="3"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="30" bgcolor="#000033" align="center"&gt;&lt;font color="#FFFFFF"&gt;WatchGallery@2008&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
Recordset1.Close();
%&gt;
&lt;%
Recordset2.Close();
%&gt;
&lt;%
Recordset3.Close();
%&gt;
&lt;%
Recordset4.Close();
%&gt;


Who can point out the error for me?

Thanks you.
reagards,
phyu

Reply to this topic