View previous topic :: View next topic |
Author |
Message |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Tue Jan 13, 2004 10:28 am Post subject: [resolved] VDSDB > Using " ' " in a WHERE tag |
|
|
Hi,
I have to select a field of a table which contains (for instance) "Vic D'Elfant". So, the sql-code should be:
Code: |
SELECT * FROM table WHERE book_title = 'Vic D'Elfant'
|
But this code doesn't work, since the search tag contains a '
Any ideas?
Regards,
Vic _________________ phpBB Development Team |
|
Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Jan 13, 2004 2:18 pm Post subject: |
|
|
Maybe you should place a slash in front of the quote ? Or maybe you can use double quotes in steed of single ones?
Code: | SELECT * FROM table WHERE book_title = 'Vic D\'Elfant' |
|
|
Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Tue Jan 13, 2004 3:09 pm Post subject: |
|
|
Doesn't work either... The ODBC driver keeps saying that there are problems with the quotes.
Vic _________________ phpBB Development Team |
|
Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Tue Jan 13, 2004 3:13 pm Post subject: |
|
|
BTW: The strange thing is, that when I execute the following code in a query running from MS Access:
Code: |
SELECT * FROM table WHERE ((book_title) = (Vic D'Elfant))
|
everything works perfect, but when executing it from within VDs (with vdsdb.dll), it says it has an syntax error, due those ()
Vic _________________ phpBB Development Team |
|
Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Jan 13, 2004 3:21 pm Post subject: |
|
|
And what if you try this?
Code: | SELECT * FROM table WHERE "(("book_title")" = "("Vic D'Elfant"))" |
|
|
Back to top |
|
 |
Raymond175 Contributor


Joined: 24 Apr 2002 Posts: 72
|
Posted: Tue Jan 13, 2004 4:01 pm Post subject: |
|
|
Replace any single qoute (') by 2 single quotes ('').
NOTE: This is not a double quote ("), but 2 single quotes!
I've read this somewhere and I'm already using it for a long time.
Raymond |
|
Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Tue Jan 13, 2004 4:02 pm Post subject: |
|
|
Thanks Raymond
Vic _________________ phpBB Development Team |
|
Back to top |
|
 |
|