the following is a bit of the code iam using! to access a database.
ConStr[0] = '\0';
strcat(ConStr, "SELECT * FROM prodlist WHERE product_name = 'aegis 1.0'");
pRecordset = m_pConnection->Execute(ConStr, vRecordsAffected, 1);
Now I want to assign it to another variable and then use the variable in place of 'aegis 1.0'.
to what variable should i assign it??
strcpy(ConStr, "SELECT * FROM prodlist WHERE product_name=");
strcat(ConStr, "'aegis 1.0'")
pRecordset = m_pConnection->Execute(ConStr, vRecordsAffected, 1);
strcpy(ConStr, "SELECT * FROM prodlist WHERE product_name=");
(ConStr, "'aegis 2.0'");//change Here ..
pRecordset = m_pConnection->Execute(ConStr, vRecordsAffected, 1);
OR
sprintf(ConStr, "SELECT * FROM prodlist WHERE product_name ='%s' ","aegis 2.0"); /// We can change Here ...
pRecordset = m_pConnection->Execute(ConStr, vRecordsAffected, 1);
Regards
Balamurali C
Last edited by ccbalamurali; October 31st, 2003 at 07:21 AM.
Bookmarks