Solved

SQL Problems on VC5.0 with ODBC

Posted on 1998-10-14
3
198 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 50 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

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

710 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