How can I pass a vaule obtained from a user to a SQL query in MFC?
I am using CRecordset::Open function to access data from a SQL Server 2005 database.
I am using it in the following way:
I have two CString type variables(c_username and c_password) which I am using to get input from the users.
CDatabase dbcon;
......
.......
CRecordset rs(&dbcon);
rs.Open(CRecordset::dynaset, _T("select * from INVENTORY..Inventory_Users where Inventory_user='c_username ' and Password='c_assword'"));
But it seems the values within c_username and c_password are not getting passed on to "Inventory_user" and "Password" to construct the query.
Can anyone help?

