Forums

ASP

This topic is locked

Syntax error (missing operator) in query expressio

Posted 01 Jan 2006 05:49:23
1
has voted
01 Jan 2006 05:49:23 Malcolm X posted:
Hey there, can anyone suggest why I am getting the following error.
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'TimberSpecies ='.
/html/results.asp, line 68

Line 68: Command1.Execute()

I have created the following command in a results.asp page.

UPDATE tblSpecies
SET fHits = fHits + 1
WHERE TimberSpecies = ParamSpecies

ParamSpecies Request.QueryString("TimberSpecies"

If it helps, I have a database with the following.

Table Name: tblSpecies
Column Names: idSpecies, TimberSpecies, fHits.

Also have included the code that Dreamweaver creates for the SQL.

<%
set Command1 = Server.CreateObject("ADODB.Command"
Command1.ActiveConnection = MM_connTimber_STRING
Command1.CommandText = "UPDATE tblSpecies SET fHits = fHits + 1 WHERE TimberSpecies = " + Replace(Command1__ParamSpecies, "'", "''" + " "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>

Thanks.
Mally.

Replies

Replied 03 Jan 2006 23:27:43
03 Jan 2006 23:27:43 jo blo replied:
Mally

ParamSpecies is not being passed through to the results.asp page.
Check the page that sends info to results.asp.

Put his before line 68 on the results.asp page:

response.write "paramSpecies = "&paramspecies
response.end

When the paramspecies variable appears - you know you've fixed the problem.

Reply to this topic