Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Problems on VC5.0 with ODBC

Posted on 1998-10-14
3
Medium Priority
?
200 Views
Last Modified: 2010-04-02
Hi experts,
I'm looking for the syntax of the sqlstatments that have a ' in the data.
My table has a Entry in Hive like this : [ULM\Dr.Salomon's]
my SQL-statments : SELECT * FROM RegistryEntry WHERE Hive = '[ULM\Dr.Salomon's]';

but the problem is the ' in Dr.Salomon's
what the solution ?
Thanks
jufer
0
Comment
Question by:jufer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:seanowens
ID: 1175092
Try doubling the single quote.  As far as I know, in normal SQL statements (not under vc5.0/ODBC) thats how you escape the single quote.  I've done it before under different development platforms.
0
 
LVL 3

Accepted Solution

by:
NullTerminator earned 200 total points
ID: 1175093
It is not a function of VC5, but of the ODBC driver and the underlying database.

1) Use double quotes around the literal so the single quote is part of the string.
SELECT * FROM RegistryEntry WHERE Hive = "[ULM\Dr.Salomon's]";

2) use `back quotes` around the string
SELECT * FROM RegistryEntry WHERE Hive = `[ULM\Dr.Salomon's]`;

'\0'
0
 

Author Comment

by:jufer
ID: 1175094
Well
it works when I double it!! Thanks  a lot to \0 and  seanowens.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question