Forums

ASP

This topic is locked

Form Search Query problem

Posted 18 Jan 2007 18:16:18
1
has voted
18 Jan 2007 18:16:18 Aaron Zimmer posted:
Hey -- THis may sound like a 2nd grade question, but I'm stupmed nonetheless. I'm trying to use a simple search to access articles in a database. I'm completely stumped as to what I'm not doing right. Any help in any way would be GREATLY appreciated! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

-Page Code copied below-

Thanks
Aaron
Dreamweaver MX|MySQL|ASP

&lt;%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%&gt;
&lt;!--#include file="Connections/WaveBiscuit.asp" --&gt;
&lt;%
var rsBlogSearch__MMColParam = "1";
if (String(Request.QueryString("input") != "undefined" &&
String(Request.QueryString("input") != "" {
rsBlogSearch__MMColParam = String(Request.QueryString("input");
}
%&gt;
&lt;%
var rsBlogSearch = Server.CreateObject("ADODB.Recordset";
rsBlogSearch.ActiveConnection = MM_WaveBiscuit_STRING;
rsBlogSearch.Source = "SELECT blog_item_id, blog_item FROM dbo187932498.blog_items WHERE blog_item LIKE '"+ rsBlogSearch__MMColParam.replace(/'/g, "''" + "%' ORDER BY blog_item_id ASC";
rsBlogSearch.CursorType = 0;
rsBlogSearch.CursorLocation = 2;
rsBlogSearch.LockType = 1;
rsBlogSearch.Open();
var rsBlogSearch_numRows = 0;
%&gt;
&lt;%
var rsdisplayblog = Server.CreateObject("ADODB.Recordset";
rsdisplayblog.ActiveConnection = MM_WaveBiscuit_STRING;
rsdisplayblog.Source = "SELECT blog_item_datetime FROM dbo187932498.blog_items ORDER BY blog_item_datetime DESC";
rsdisplayblog.CursorType = 0;
rsdisplayblog.CursorLocation = 2;
rsdisplayblog.LockType = 1;
rsdisplayblog.Open();
var rsdisplayblog_numRows = 0;
%&gt;
&lt;%
var Repeat1__numRows = -1;
var Repeat1__index = 0;
rsBlogSearch_numRows += Repeat1__numRows;
%&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;WaveBiscuit - Biscuit Says!&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;style type="text/css"&gt;
&lt;!--
.border {
right: 20px;
text-indent: 20pt;
}
--&gt;
&lt;/style&gt;
&lt;script language="JavaScript" type="text/JavaScript"&gt;
&lt;!--
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&lt;a.length; i++)
if (a[i].indexOf("#"!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i&lt;a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?")&gt;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&lt;d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i&lt;d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i&lt;(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body bgcolor="#E8E0CF" onLoad="MM_preloadImages('Elements/Elements/images/SplashBar_r2_c2.gif','Elements/Elements/images/SplashBar_r2_c2_f2.gif','Elements/Elements/images/SplashBar_r2_c3.gif','Elements/Elements/images/SplashBar_r2_c3_f3.gif','Elements/Elements/images/SplashBar_r2_c4.gif','Elements/Elements/images/SplashBar_r2_c4_f4.gif','Elements/Elements/images/SplashBar_r2_c6_f5.gif')"&gt;
&lt;table width="980" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"&gt;
&lt;!--DWLayoutTable--&gt;
&lt;tr&gt;
&lt;td height="170" colspan="5" valign="top"&gt;&lt;table border="0" cellpadding="0" cellspacing="0" width="978"&gt;
&lt;!--DWLayoutTable--&gt;
&lt;!-- fwtable fwsrc="SplashBar.png" fwbase="SplashBar.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" --&gt;
&lt;tr&gt;
&lt;td width="979" height="151" valign="top"&gt;&lt;table border="0" cellpadding="0" cellspacing="0" width="978"&gt;
&lt;!--DWLayoutTable--&gt;
&lt;!-- fwtable fwsrc="SplashBar.png" fwbase="SplashBar.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" --&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="209" height="1" border="0"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="182" height="1" border="0"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="171" height="1" border="0"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="156" height="1" border="0"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="10" height="1" border="0"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="153" height="1" border="0"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="97" height="1" border="0"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="1" height="1" border="0"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="7"&gt;&lt;img name="SplashBar_r1_c1" src="Elements/Elements/images/SplashBar_r1_c1.gif" width="978" height="7" border="0" alt=""&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="1" height="7" border="0"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td rowspan="2"&gt;&lt;img name="SplashBar_r2_c1" src="Elements/Elements/images/SplashBar_r2_c1.gif" width="209" height="143" border="0" usemap="#m_SplashBar_r2_c1" alt=""&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#" onMouseOut="MM_swapImage('SplashBar_r2_c2','','Elements/Elements/images/SplashBar_r2_c2.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c2','','Elements/Elements/images/SplashBar_r2_c2_f2.gif',1);"&gt;&lt;img name="SplashBar_r2_c2" src="Elements/Elements/images/SplashBar_r2_c2.gif" width="182" height="57" border="0" usemap="#m_SplashBar_r2_c2" alt=""&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#" onMouseOut="MM_swapImage('SplashBar_r2_c3','','Elements/Elements/images/SplashBar_r2_c3.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c3','','Elements/Elements/images/SplashBar_r2_c3_f3.gif',1);"&gt;&lt;img name="SplashBar_r2_c3" src="Elements/Elements/images/SplashBar_r2_c3.gif" width="171" height="57" border="0" usemap="#m_SplashBar_r2_c3" alt=""&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#" onMouseOut="MM_swapImage('SplashBar_r2_c4','','Elements/Elements/images/SplashBar_r2_c4.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c4','','Elements/Elements/images/SplashBar_r2_c4_f4.gif',1);"&gt;&lt;img name="SplashBar_r2_c4" src="Elements/Elements/images/SplashBar_r2_c4.gif" width="156" height="57" border="0" usemap="#m_SplashBar_r2_c4" alt=""&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td rowspan="2"&gt;&lt;img name="SplashBar_r2_c5" src="Elements/Elements/images/SplashBar_r2_c5.gif" width="10" height="143" border="0" alt=""&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="index.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('SplashBar_r2_c6','','Elements/Elements/images/SplashBar_r2_c6_f5.gif',1);"&gt;&lt;img name="SplashBar_r2_c6" src="Elements/Elements/images/SplashBar_r2_c6.gif" width="153" height="57" border="0" alt=""&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td rowspan="2"&gt;&lt;img name="SplashBar_r2_c7" src="Elements/Elements/images/SplashBar_r2_c7.gif" width="97" height="143" border="0" alt=""&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="1" height="57" border="0"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="3"&gt;&lt;img name="SplashBar_r3_c2" src="Elements/Elements/images/SplashBar_r3_c2.gif" width="509" height="86" border="0" alt=""&gt;&lt;/td&gt;
&lt;td&gt;&lt;img name="SplashBar_r3_c6" src="Elements/Elements/images/SplashBar_r3_c6.gif" width="153" height="86" border="0" alt=""&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="1" height="86" border="0"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;map name="m_SplashBar_r2_c1"&gt;
&lt;area shape="rect" coords="7,5,201,136" href="index.asp" alt="" &gt;
&lt;/map&gt;
&lt;map name="m_SplashBar_r2_c2"&gt;
&lt;area shape="rect" coords="0,0,182,57" href="archive.asp" alt="" onMouseOut="MM_swapImage('SplashBar_r2_c2','','Elements/Elements/images/SplashBar_r2_c2.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c2','','Elements/Elements/images/SplashBar_r2_c2_f2.gif',1);" &gt;
&lt;/map&gt;
&lt;map name="m_SplashBar_r2_c3"&gt;
&lt;area shape="rect" coords="0,0,171,57" href="askbiscuit.asp" alt="" onMouseOut="MM_swapImage('SplashBar_r2_c3','','Elements/Elements/images/SplashBar_r2_c3.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c3','','Elements/Elements/images/SplashBar_r2_c3_f3.gif',1);" &gt;
&lt;/map&gt;
&lt;map name="m_SplashBar_r2_c4"&gt;
&lt;area shape="rect" coords="0,0,156,57" href="biscuitsays.asp" alt="" onMouseOut="MM_swapImage('SplashBar_r2_c4','','Elements/Elements/images/SplashBar_r2_c4.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c4','','Elements/Elements/images/SplashBar_r2_c4_f4.gif',1);" &gt;
&lt;/map&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="19" valign="top" bgcolor="#FFFFFF"&gt;&lt;font face="Arial"&gt;&nbsp;&nbsp;&nbsp;&nbsp;Last
Updated: &lt;%=(rsdisplayblog.Fields.Item("blog_item_datetime".Value)%&gt;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="19" colspan="5" valign="top"&gt;&lt;img src="Elements/SplashBar/SplashBarBottom.jpg" width="980" height="19"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="#FFFFFF"&gt;
&lt;td height="41" colspan="5" valign="top"&gt; &lt;div align="center"&gt;&lt;img src="Elements/Elements/AskBiscuitTopBar.gif" width="761" height="41"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="20" colspan="5" valign="top" bgcolor="#FFFFFF"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="214" rowspan="2" valign="top"&gt;&lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;
&lt;!--DWLayoutTable--&gt;
&lt;tr&gt;
&lt;td width="34" height="200"&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="3" valign="top" bgcolor="#FFFFCC"&gt;&lt;div align="center"&gt;&lt;img src="Elements/Elements/Ad3.gif" width="150" height="200"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="30"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="29"&gt;&nbsp;&lt;/td&gt;
&lt;td width="11"&gt;&nbsp;&lt;/td&gt;
&lt;td width="130"&gt;&nbsp;&lt;/td&gt;
&lt;td width="9"&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="183"&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td valign="top"&gt;&lt;img src="Elements/Elements/Ad3.jpg" width="130" height="183"&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="132"&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;td height="431" colspan="3" valign="top" bgcolor="#FFFFFF"&gt; &lt;% while ((Repeat1__numRows-- != 0) && (!rsBlogSearch.EOF)) { %&gt;
&lt;p class="border"&gt;&lt;font size="5" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;&lt;%=(rsBlogSearch.Fields.Item("blog_item_ID".Value)%&gt;&lt;br&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;font face="Arial, Helvetica, sans-serif"&gt;&lt;%=(rsBlogSearch.Fields.Item("blog_item".Value)%&gt;&lt;/font&gt;&lt;font color="#CC0000" face="Arial, Helvetica, sans-serif"&gt;&lt;br&gt;
________________________________________________&lt;/font&gt;&lt;/p&gt;
&lt;%
Repeat1__index++;
rsBlogSearch.MoveNext();
}
%&gt;
&lt;/td&gt;
&lt;td width="214" rowspan="2" valign="top"&gt;&lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;
&lt;!--DWLayoutTable--&gt;
&lt;tr&gt;
&lt;td width="214" height="257" valign="top"&gt;&lt;div align="center"&gt;&lt;img src="Elements/Elements/BeachNutsBox.jpg" width="177" height="233"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="107" valign="top"&gt;&lt;div align="center"&gt;&lt;img src="Elements/Elements/Ad2.jpg" width="150" height="120"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="19"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="104" valign="top"&gt;&lt;div align="center"&gt;&lt;img src="Elements/Elements/Ad1.gif" width="209" height="97"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="44"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="89" height="113" valign="top" bgcolor="#FFFFFF"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;td width="346" valign="top"&gt;&lt;img src="Elements/Elements/Disclaimer.gif" width="346" height="100"&gt;&lt;/td&gt;
&lt;td width="117" valign="top" bgcolor="#FFFFFF"&gt;&lt;!--DWLayoutEmptyCell--&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="19" colspan="5" valign="top"&gt;&lt;img src="Elements/SplashBar/SplashBarBottom.jpg" width="980" height="19"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsBlogSearch.Close();
%&gt;
&lt;%
rsdisplayblog.Close();
%&gt;

Reply to this topic