Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Thanked 0 Times in 0 Posts

    apostrophe's throwing off code (FP 2003)


    I used the DB Interface Wizard to create a DB and associated entry pages. However, when someone enters text into a text box that contains an apostrophe (') it mucks up the works and displays an error when submitted. The error is as follows:

    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression "the text is here blah blah blah on Jims's desk'.

    Can anyone tell me how to have it ignore the apostrophes and not consider them code additions??

    Thanks in advance, KofSeattle

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 94 Times in 90 Posts

    Re: apostrophe's throwing off code (FP 2003)

    My guess is that the database query that FrontPage is creating for you uses the apostrophe character ( ' ) to begin and end user input. For example, the query might contain something like:

    ... dbNameField=' & user input here & ' AND blah blah blah...

    the apostrophe in the user input leads the query processor to expect an AND or other appropriate term where the user's text continues.

    You can "fix" this by changing the query to use quotation marks ( " ), but only if you override FrontPage and your input will never include quotation marks. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    There may well be other solutions. I think the Access board is the place where most wisdom about database stuff can be found.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts