Solved

SQL Problems on VC5.0 with ODBC

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cross compile release version of c++ program for linux 2 132
C++ question 3 65
Eclipse IDE - Cannot copy/paste from console output 8 191
c++, dynamic object by json 1 42
  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 …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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.

772 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