Solved

How to use Win32 API functions for ODBC Programming?

Posted on 1998-10-21
1
835 Views
Last Modified: 2012-06-22
I'm using VC++ 5.0 to develop a application which could
access SYBASE Database through ODBC.
there is a SQL statement as the following:
SELECT name,age FROM TableName WHERE name='tony'
I call SQLExeDirect() to execute it,but now I want to
substitue the name field with a variable,such as the
following :
namestring="tony";
SQLExeDirect(...,"SELECT name,age FROM TableName WHERE name=namestring",...);
at this time ,this function cannot execute properly,it show error message
that cannot recognize 'namesring'.
I want to use variable in a SQL statement,How to
solve this problem?

0
Comment
Question by:aiqing
1 Comment
 

Accepted Solution

by:
avivl earned 50 total points
ID: 1175698
Try this
namestring="tony";
QuryString ="SELECT name,age FROM TableName WHERE name="
SQLExeDirect(...,"QuryString +namestring,....);
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

820 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