Solved

SQL Problems on VC5.0 with ODBC

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

  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 …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now