Print Page | Close Window

Names with apostrophes

Printed From: Nasgaweb
Category: Nasgaweb Forums
Forum Name: Database
Forum Discription: This forum is for discussion about the NASGA on-line database.
URL: http://www.nasgaweb.com/forum/forum_posts.asp?TID=15877
Printed Date: 3/26/26 at 3:48pm
Software Version: Web Wiz Forums 10.11 - http://www.webwizforums.com


Topic: Names with apostrophes
Posted By: McSanta
Subject: Names with apostrophes
Date Posted: 1/11/13 at 7:56am
It appears that your queries does not handle names with apostrophes -- such as selecting the 2012 All Amatuers database then selecting a thrower like Jon O'Neil results in the following error message: 

Microsoft JET Database Engine

error '80040e14'

Syntax error (missing operator) in query expression 'Year(Games.Gamesstart) = 2012 AND Athletes.Firstname='Jon' AND Athletes.Lastname='O'Neil' ORDER BY Games.Gamesstart;'.

/dbase/resultsathlete3.asp, line 74

Or when you select the person directly from the main menu, the following error is generated
 

Microsoft VBScript runtime

error '800a0005'

Invalid procedure call or argument: 'Left'

/dbase/resultsathlete3.asp, line 44

my guess and the obvious guess is the SQL is being screwed up by the apostrophe in the throwers name -- In case you did not knwo, I though you should be made aware of this .

 
 
 
 
 


-------------
Mark McVey

"The work of science is to substitute facts for appearances and demonstrations for impressions." -John Ruskin



Replies:
Posted By: Max5684
Date Posted: 7/21/14 at 3:19pm
You are correct. This is a problem with the query string not being properly sanitized before being run against the database. You can get around this by two single quotes ('') - not a double quote (") - in place of the single quote.

I have asked the owner of the database to let me lend a hand with rewriting the back-end and interface but I haven't heard back yet.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 10.11 - http://www.webwizforums.com
Copyright ©2001-2012 Web Wiz Ltd. - http://www.webwiz.co.uk