0

Hi all,

I want to make a string like this:

SELECT * FROM "Alexander de Groot"

.
So i can later execute that sql statment.

Im only having a problem creating the string. Let me show you:

string sTableName;
char *SqlTableName;
sTableName = DBLookupComboBox1->Text.c_str();
SqlTableName = new char[sTableName.size()+ 20];
strcpy(SqlTableName,"SELECT * FROM ""); // The )'; at the end of the line is now quoted
strcat(SqlTableName,sTableName.c_str());
strcat(SqlTableName, """); // Same here de ); is quoted

So my question is how can i add

"

to the string without quoting all the stuff behind it?

Thanks anyhow,

Alexander de Groot

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by elexender
0

" is a special character as it delimits the string. If you want a " in your string you need to escape it using \ so the compiler treats it as a character in the string and not a string delimiter like this "\""

Edited by Banfa: Adding clarity

0

" is a special character as it delimits the string. If you want a " in your string you need to escape it using \ so the compiler treats it as a character in the string and not a string delimiter like this "\""

Thanks for ur reply Banfa!! Didnt how to do it...:$ ... thank again

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.