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

x
?
Solved

How to use Win32 API functions for ODBC Programming?

Posted on 1998-10-21
1
Medium Priority
?
865 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
[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
1 Comment
 

Accepted Solution

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

Featured Post

Technology Partners: 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

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…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

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