| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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> </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 |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > error in code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|