#5 SQLServer bug if a ' is used in a query

Persistence (3)

When building the query for a retrieve on a field with a
quote we get a statement like select * from users where
(user_id = 'Paul''s Test').

The search value Paul' Test, gets quotes, and all quotes
in the string get a preceeding quote too. This probably
works fine for Oracle, but in SQLServer it does not seem
to work

However when writing a record with a field with a quote it
in, it works.

To to test, create a basic maintenace form (with add and
delete options, add a row with a ' in the key field. Now
try and delete the row. It should fail, as it can construct
a valid where clause to delete the row.


  • Gautam Jolly

    Gautam Jolly - 2003-09-11

    Logged In: YES

    1) Fixed the class 'TypeDefs' to not replace quote characters
    when using PreparedStatements
    2) Added a UnitTest to check the fix

  • Gautam Jolly

    Gautam Jolly - 2003-09-11
    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks