forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[resolved] VDSDB > Using " ' " in a WHERE tag

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    forum.vdsworld.com Forum Index -> Product Support
View previous topic :: View next topic  
Author Message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Tue Jan 13, 2004 10:28 am    Post subject: [resolved] VDSDB > Using " ' " in a WHERE tag Reply with quote

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 ' Confused

Any ideas?

Regards,
Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Jan 13, 2004 2:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Tue Jan 13, 2004 3:09 pm    Post subject: Reply with quote

Doesn't work either... Confused The ODBC driver keeps saying that there are problems with the quotes.

Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Tue Jan 13, 2004 3:13 pm    Post subject: Reply with quote

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 () Confused

Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Jan 13, 2004 3:21 pm    Post subject: Reply with quote

And what if you try this?

Code:
SELECT * FROM table WHERE "(("book_title")" = "("Vic D'Elfant"))"
Back to top
View user's profile Send private message
Raymond175
Contributor
Contributor


Joined: 24 Apr 2002
Posts: 72

PostPosted: Tue Jan 13, 2004 4:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Tue Jan 13, 2004 4:02 pm    Post subject: Reply with quote

Thanks Raymond Very Happy

Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    forum.vdsworld.com Forum Index -> Product Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group