Author |
Topic  |
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 28 June 2010 : 15:49:53
|
I am getting this error when creating a new category...
Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near 's'.
/Forum/admin_recipe.asp, line 71
line 71 is in red
any ideas??
EDIT: I think it may have been because there was an ' in the text for the new category
Dave |
No good at coding, but I can plough a field !! |
Edited by - thermal_seeker on 28 June 2010 17:06:30 |
|
MarcelG
Retired Support Moderator
    
Netherlands
2625 Posts |
|
Classicmotorcycling
Development Team Leader
    
Australia
2085 Posts |
Posted - 29 June 2010 : 04:09:40
|
This is what was released in the code for that area and I have not had an issue:
|
Cheers, David Greening |
 |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 29 June 2010 : 08:02:26
|
MarcelG, yes it should be on the next line, it is in my file, it must have happened as I copied over.
I have found it is the ' that is causing the error.
Test's gives the error and Tests does not.
Dave |
No good at coding, but I can plough a field !! |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 29 June 2010 : 09:20:39
|
Is the newcat variable being sanitised anywhere using the chkString function?
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 29 June 2010 : 19:09:54
|
The variable is being checked, the problem must be either (1) a mod to Thermal_Seeker's "inc_func_common.asp" which affects the chkString function, or (2) a change to his "admin_recipe.asp". I suspect it's the first because the line number for the error is correct.
[edit]I really should read what I type before hitting submit. lol Didn't mean "inc_header" but "inc_func_common". |
Edited by - Carefree on 30 June 2010 10:00:33 |
 |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 30 June 2010 : 01:44:50
|
What should I be looking for in inc_header??
Dave |
No good at coding, but I can plough a field !! |
 |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 30 June 2010 : 02:42:28
|
I have spotted something else Trust me!!
Someone has posted a recipe and when viewed by someone else the "Contributor" is showing as the person viewing rather than the original poster.??
Dave |
No good at coding, but I can plough a field !! |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 30 June 2010 : 09:59:15
|
Post a link to your "inc_func_common.asp" in .txt format for us to look at (to review your chkString function).
For the second issue:
In "recipe.asp", look for the following lines (appx 1405 - 1413):
Change them to read:
|
 |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 30 June 2010 : 13:18:35
|
Inc_func_common
Thanks for the recipe change Carefree.. 
Dave
|
No good at coding, but I can plough a field !! |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 30 June 2010 : 14:43:17
|
The cause is not in "inc_func_common.asp", so it must be in a change to your "recipe.asp" file. Post what you have in .txt format and we can try and solve this. |
 |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 30 June 2010 : 15:52:08
|
recipe
Thanks
Dave |
No good at coding, but I can plough a field !! |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 30 June 2010 : 20:59:50
|
See what I mean about not reading before I submit a message? The file I need to look at isn't "recipe.asp" but "admin_recipe.asp". Please give me a link to a .txt version of it. |
 |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 01 July 2010 : 01:03:36
|
quote: Originally posted by Carefree
See what I mean about not reading before I submit a message? The file I need to look at isn't "recipe.asp" but "admin_recipe.asp". Please give me a link to a .txt version of it.
admin_recipe.asp |
No good at coding, but I can plough a field !! |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 01 July 2010 : 01:43:57
|
No problem on your file, but here's a work-around (since you're using Sql, we'll use an apostrophe to escape the apostrophe).
In "admin_recipe.asp", search for the following line (appx 64):
newcat = trim(chkString(Request.Form("newcat"), "title"))
Immediately after that, insert this line:
newcat=newcat.Replace("'", "''") |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 01 July 2010 : 04:23:16
|
If the only use for newcat is passing it through to that SQL string then you should use "sqlstring" instead of "title" when passing it through chkString; that will sanitise it properly for each database type. If newcat is being used in a number of places in different ways then it should be passed through chkString each time, using the appropriate string type.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
Topic  |
|