embedding variable inside sql statement

This is a discussion on embedding variable inside sql statement within the C++ Programming forums, part of the General Programming Boards category; Well I finally managed to get my connection issue worked out and use a select statement in my program, but ...

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    164

    Question embedding variable inside sql statement

    Well I finally managed to get my connection issue worked out and use a select statement in my program, but I am new pointers and stuck with using variables inside my sql statement

    CString *myvariable;

    *myvariable = m_UserInputVariable;

    sqlStatement("SELECT from Table where name like '&myvariable%'")

    I am very new to pointers and not even sure if I'm heading in the right direction. Can anyone show me an example or point me to the direction of how I might accomplish this?

    I apologize for the horrible code tag usage, I will be reviewing the documentation on this site directly.

    Thanks for any help.

  2. #2
    Registered User
    Join Date
    May 2004
    Posts
    164
    Never mind, I found a way to do it without pointers, after reading more on pointers they did not see the way to go, so I used a series of CStrings and them pass that to the CRecordset:: class and it seemed to work.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need some help...
    By darkconvoy in forum C Programming
    Replies: 32
    Last Post: 04-29-2008, 03:33 PM
  2. counting vowels
    By trippedwire in forum C++ Programming
    Replies: 10
    Last Post: 10-01-2004, 11:58 PM
  3. switch statement inside a do while
    By Chaplin27 in forum C++ Programming
    Replies: 4
    Last Post: 09-14-2004, 08:33 PM
  4. cin.get() inside switch statement
    By timberwolf5480 in forum C++ Programming
    Replies: 2
    Last Post: 11-30-2003, 12:26 AM
  5. Uh-oh! I am having a major switch problem!
    By goodn in forum C Programming
    Replies: 4
    Last Post: 11-01-2001, 03:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21