Results 1 to 3 of 3
  1. #1
    3 Star Lounger Jimmy-W's Avatar
    Join Date
    Jan 2001
    Location
    Helena, Montana, USA
    Posts
    220
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Escaping words that are statements, etc.

    I'm not sure that my question is appropriate for this section, but I'll give it a try. I building SQLs queries in an application, which is pretty much built from Access, to find text strings in records. The problem is that certain words, like insert and update, kill the query. Is there way to escape these words? As a workaround, I used *nsert and *pdate. I have other (special) characters that cause problems, but I can escape them, such as [?]. Thanks.
    JimmyW
    Helena, MT

  2. #2
    Star Lounger tgw7078's Avatar
    Join Date
    Jul 2010
    Location
    Seattle, WA., USA
    Posts
    90
    Thanks
    1
    Thanked 12 Times in 12 Posts
    How are you building your queries? Are you using query design view or SQL view, building them in VBA code, etc.?
    Are you able to post a small generic sample (no confidential data) that demonstrates this error?
    Tom Wickerath
    Microsoft Access MVP
    4/1/2006 - 3/31/2012

  3. #3
    3 Star Lounger Jimmy-W's Avatar
    Join Date
    Jan 2001
    Location
    Helena, Montana, USA
    Posts
    220
    Thanks
    13
    Thanked 0 Times in 0 Posts
    Thanks, Tom. I'm searching on a list of file paths. An example is below. The table is History, and the field is AbsoultePath. The query fails because a record includes the word delete. I can substitute *elete.

    SELECT * FROM [History] WHERE
    [History.AbsolutePath] LIKE '*path\jimmy\Movies\myfirst file.mpg' OR
    [History.AbsolutePath] LIKE '*path\jimmy\Movies\how to delete portions of files.pdf' OR
    [History.AbsolutePath] LIKE '*path\backups\machine 1\specials\Special edition\ford truck\16.JPG'
    JimmyW
    Helena, MT

Posting Permissions

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