|
-
Jun 28th, 2001, 05:48 AM
#1
Thread Starter
Addicted Member
ASP Error
Can someone tell me why this piece of code generated an error if i send the following URL to it:
prodinfo.asp?type=tiles&name=interface
(I have a table called tiles and a record for interface)
Code:
<html>
<body>
<%
Dim objRS
Dim objConn
Dim strLocation
Dim PType
Dim PName
strLocation = Server.MapPath("/db/products.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strLocation & ";"
PType = Request.QueryString("type")
PName = Request.QueryString("name")
Set objRS = objConn.Execute ("SELECT * FROM " & Request.QueryString("type") & "WHERE Name = " & Request.QueryString("name"))
Response.Write ("<div align=center>")
Response.Write ("<font face='Tahoma' size=5 color=Navy>")
Response.Write PName
Response.Write ("<hr width=100><br><font size=3>")
If objRS.Fields("ImageLocation") <> "" Then
Response.Write ("<table border=0 width='100%'>")
Response.Write ("<tr>")
Response.Write ("<td width='67%' valign='top' align='justify'>" & objRS.Fields("Information") & "</td>")
Response.Write ("<td width='33%'><img border=0 src=" & objRS.Fields("ImageLocation") & " align='right' width='200' height='200'></td>")
Response.Write ("</tr>")
Response.Write ("</table>")
Else
Response.Write objRS.Fields ("Information")
End If
Response.Write ("<br><hr width=100><br>")
Response.Write ("Website: " & objRS.Fields("Website"))
%>
</body>
</html>
The bold part produced a syntax error with the FROM command
-
Jun 28th, 2001, 06:27 AM
#2
Just put a space before the WHERE and it should solve your problem
Cheers!
Abhijit
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Jun 28th, 2001, 06:33 AM
#3
Thread Starter
Addicted Member
Doh! How silly of me
-
Jun 28th, 2001, 01:25 PM
#4
Frenzied Member
I hate it when that happens :c)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|