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

" 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 "\""

" 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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.