Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 4th, 2004, 07:09 AM
sk8ter04 sk8ter04 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 22 sk8ter04 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 40 m 40 sec
Reputation Power: 0
Question error in code

hello all i just am trying to work out what is wrong with this code so if anyone could plez look over the code i am going to supply and see where i have gone wrong the code that i have is i am getting an error in the mySQL statement which im not sure what is wrong with it, the thing i need it to do is i have 3 different entries i need it to grab information out of the database for and that what i put into the SQL statement but its not working for some reason. so here is the code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {color: #000000}
-->
</style>
</head>
<%
myDSN = "DBQ=" & Server.MapPath("/Database/SPen.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
mySQL = "Select * From [tblBusinessDetails] Where [Business Name][Suburb][Category] Like %'" & request.Form("txtbusinessname") & %" & request.Form("txtsuburb") & %" & request.Form("txtcategory") %"';"
Set CategoryRS = Server.CreateObject("ADODB.RecordSet")
CategoryRS.Open mySQL, myDSN
%>
<body>
<p align="center">Browse For Business </p>
<div align="center">
<form name="form1" method="post" action="display.asp">
<table width="275" border="1">
<tr>
<td width="114">Business Name </td>
<td width="8"><input name="txtbusinessname" type="text" id="txtbusinessname"></td>
</tr>
<tr>
<td>Suburb</td>
<td><input name="txtsuburb" type="text" id="txtsuburb"></td>
</tr>
<tr>
<td>Category</td>
<td><input name="txtcategory" type="text" id="txtcategory"></td>
</tr>
</table>
<p>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</p>
</form>
</div>
<p>&nbsp;</p>
</body>
</html>

and the error i am getting is this one




Microsoft VBScript compilation error '800a0408'

Invalid character

/Browse.asp, line 15 mySQL = "Select * From [tblBusinessDetails] Where [Business Name][Suburb][Category] Like %'" & request.Form("txtbusinessname") & %" & request.Form("txtsuburb") & %" & request.Form("txtcategory") %"';" so if anyone could have alook at that code and tell me where i have gone wrong it will be a big help to me

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > error in code


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT