|
-
April 21st, 1999, 12:11 PM
#1
Writing SQL statement
How do you write a SQL statement with text in vc. I tried [\"sometext\"], but this does not work.
-
April 21st, 1999, 01:33 PM
#2
Re: Writing SQL statement
I am a little confused as to what you are trying to do but here is a sample.
Hope it helps.
CString sqlWhere;
sqlWhere.Format("WHERE eip.[Institution] = %ld AND eip.[Type] = 'Reason' ", m_instID);
-
April 23rd, 1999, 12:09 AM
#3
Re: Writing SQL statement
CDatabase* db;
// Get db from somewhere, e.g. db = new CDatabase; db->Open(...);
CString cCustName = "The Customer";
CString cSQL;
cSQL.Format( "INSERT INTO customers (NAME) VALUES( '%s' )", cCustName );
// Here you have the value:
// "INSERT INTO customers (NAME) VALUES( 'The Customer' )" in cSQL
db->Execute( cSQL );
I hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|