Personally, I'd use sprintf() or, if using VC, CString::Format() to build the sql request, but I prefer C-style coding over std containers for the most part (that's the way I learned):
Code:int itemnumber=101; char sqlbuf[100]; //make it big enough to hold your entire statement sprintf(buf,"SELECT * FROM USERTABLE WHERE itemnumber='%d' AND loginpw='%s' ORDER BY loginid",itemnumber,"MyPassword"); if(!db.Execute(sqlbuf,tbl)){ //... }




Reply With Quote
