ADO - UPDATE -newbie
-
Hi again i wrote this function to update a record in access using ADO but i get an error can anyone find out whats wrong int valField5; int valField2; double valField4; string command; _bstr_t strtest=valField4; pCommand->ActiveConnection = m_pConn;//previously opened connection command="UPDATE tblDictionary SET Spam="+valField2; command+=",Pos="+strtest;//when i write pos="valField4; i get compilation error command+=",app="+valField5; command+=" WHERE token='"+ token; command+="'"; _bstr_t strSQLstatment=command.c_str(); variant_t vntRecordAffected; m_pConn->Execute(strSQLstatment,&vntRecordAffected,adCmdText); It compiles ok but then i get an error Error:Θï█ Press any key to continue i know my question is not very clear but if u can see anything that might cause the error pls let me know. is it because i'm not giving the values for all columns of the record in the database table i have token text Spam number Ham number Pos number(with decimal) app number i only try to update some values is that correct thanks again
-
Hi again i wrote this function to update a record in access using ADO but i get an error can anyone find out whats wrong int valField5; int valField2; double valField4; string command; _bstr_t strtest=valField4; pCommand->ActiveConnection = m_pConn;//previously opened connection command="UPDATE tblDictionary SET Spam="+valField2; command+=",Pos="+strtest;//when i write pos="valField4; i get compilation error command+=",app="+valField5; command+=" WHERE token='"+ token; command+="'"; _bstr_t strSQLstatment=command.c_str(); variant_t vntRecordAffected; m_pConn->Execute(strSQLstatment,&vntRecordAffected,adCmdText); It compiles ok but then i get an error Error:Θï█ Press any key to continue i know my question is not very clear but if u can see anything that might cause the error pls let me know. is it because i'm not giving the values for all columns of the record in the database table i have token text Spam number Ham number Pos number(with decimal) app number i only try to update some values is that correct thanks again
Please Display! the error properly.
--[V]-- [My Current Status] -- modified at 7:25 Monday 5th June, 2006
-
Hi again i wrote this function to update a record in access using ADO but i get an error can anyone find out whats wrong int valField5; int valField2; double valField4; string command; _bstr_t strtest=valField4; pCommand->ActiveConnection = m_pConn;//previously opened connection command="UPDATE tblDictionary SET Spam="+valField2; command+=",Pos="+strtest;//when i write pos="valField4; i get compilation error command+=",app="+valField5; command+=" WHERE token='"+ token; command+="'"; _bstr_t strSQLstatment=command.c_str(); variant_t vntRecordAffected; m_pConn->Execute(strSQLstatment,&vntRecordAffected,adCmdText); It compiles ok but then i get an error Error:Θï█ Press any key to continue i know my question is not very clear but if u can see anything that might cause the error pls let me know. is it because i'm not giving the values for all columns of the record in the database table i have token text Spam number Ham number Pos number(with decimal) app number i only try to update some values is that correct thanks again
antonaras wrote:
command+=",Pos="+strtest;//when i write pos="valField4; i get compilation error
Have you tried:
command += ",Pos=";
command += valField4;
"The largest fire starts but with the smallest spark." - David Crow