-
August 24th, 2009, 11:41 AM
#1
insert to database from visual c++
i have built aplication to insert data from database. i have two variables they are m_UserName and m_Password.
my code like this :
CDatabase db;
db.OpenEx(_T("DSN=billing test; UID = root"),CDatabase::noOdbcDialog);
db.ExecuteSQL("INSERT INTO user VALUES ('m_UserName' , 'm_Password')");
why were data inserted in my database m_UserName and m_Password? not the value of that variable? if i want to insert the value of the variable, what should i do?
thanks for every think....
-
August 24th, 2009, 12:04 PM
#2
Re: insert to database from visual c++
Because you used string literals instead of variables in your code.
-
August 24th, 2009, 11:06 PM
#3
Re: insert to database from visual c++
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
|