• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

500 points - SQL Help...

Mike Eghtebas
Mike Eghtebas
  • 2
1 Solution
Are you sure that none of your string values inserted in your query are free of an apostrophe?  It would only take one to make everything crash....


When compiling your SQL string any string values with the character --> '  
must be doubled up -->  ''   <-- two apostrophizes
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
Hi Rick_Rickards,

As it is stated in the original question, the submitted SQL works just fine without Where clause. So, all those Replace(fieldValue,"'","''")  etc. are fine.

If the code snippet below does not work below can you run the following code....

Debug.print " Where ((tEmails.SentOn <> #" & .SentOn & "#) and (tEmails.SenderInitials <> '" & strInitials & "'));"

and then post what it says.  The answer is no doubt in there.
" Where ((tEmails.SentOn <> #" & CDate(.SentOn) & "#) and (tEmails.SenderInitials <> '" & Replace(strInitials,"'","''") & "'));"

Open in new window

Forced accept.

EE Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now