Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
malhyp
Starting Member
21 Posts |
Posted - 2005-12-31 : 20:37:05
|
| 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 'TimberSpeices ='./html/results.asp, line 68Line 68: Command1.Execute()I have created the following command in a results.asp page.UPDATE tblSpecies SET fHits = + 1 WHERE TimberSpecies = ParamSpeciesParamSpecies Request.QueryString("TimberSpecies")If it helps, I have a database with the following.Table Name: tblSpeciesColumn Names: idSpecies, TimberSpeices, fHits.Also have included the code that Dreamweaver creates for the SQL.<%set Command1 = Server.CreateObject("ADODB.Command")Command1.ActiveConnection = MM_connTimber_STRINGCommand1.CommandText = "UPDATE tblSpecies SET fHits = + 1 WHERE TimberSpeices = " + Replace(Command1__ParamSpecies, "'", "''") + " "Command1.CommandType = 1Command1.CommandTimeout = 0Command1.Prepared = trueCommand1.Execute()%>Thanks.Mally. |
|
|
r937
Posting Yak Master
112 Posts |
Posted - 2005-12-31 : 20:41:14
|
| you'll probably want to put the value that you're comparing TimberSpeices to in single quotesWHERE TimberSpeices = '" + Replace(Command1__ParamSpecies, "'", "''") + "' "also, this sets fHits to 1 -- SET fHits = + 1to increment it, you'll want to use this instead --SET fHits = fHits + 1rudyhttp://r937.com/ |
 |
|
|
malhyp
Starting Member
21 Posts |
Posted - 2005-12-31 : 20:57:29
|
| Hey there, thanks for the reply. I didn chaneg my SQL to fead this.WHERE TimberSpeices = '" + Replace(Command1__ParamSpecies, "'", "''") + "' "and also changed to this.SET fHits = fHits + 1No longer get the error, but nor result in the Access database.Any ideas? |
 |
|
|
r937
Posting Yak Master
112 Posts |
Posted - 2005-12-31 : 21:15:16
|
| possibly you don't have any rows with the value passed inrudyhttp://r937.com/ |
 |
|
|
malhyp
Starting Member
21 Posts |
Posted - 2005-12-31 : 21:54:07
|
| Sorry, what do you mean by that? |
 |
|
|
r937
Posting Yak Master
112 Posts |
Posted - 2005-12-31 : 22:26:03
|
| i mean that when this --WHERE TimberSpeices = '" + Replace(Command1__ParamSpecies, "'", "''") + "' "is run, there aren't any rows with TimberSpeices equal to whatever value that Command1 thing isrudyhttp://r937.com/ |
 |
|
|
|
|
|
|
|