Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

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

v1.2
closed
Gautam Jolly
Persistence (3)
5
2003-09-11
2003-05-01
Anonymous
No

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.

Discussion

  • Gautam Jolly
    Gautam Jolly
    2003-09-11

    Logged In: YES
    user_id=544801

    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