Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-08-23 : 09:38:33
|
| Harnik writes "sql error:Error cannot convert datatype varchar to numeric.I got this error in update query.Call ac.UpdateNewprofile(cid....,..,..,)where actual query is in class file(cUserinfo.asp)function update...(p_id,...,..)dim strSQLstrSQL = " UPDATE CPersonal SET "strSQL = strSQL & " ClientName = '" & p_name & "', ClientDOB = '" & p_dob & "', "strSQL = strSQL & " ClientAdd = '" & p_add & "', ClientEmail = '" & p_email & "', "strSQL = strSQL & " ClientMobile = '" & p_mobile & "', ClientBank = '" & p_bank & "', "strSQL = strSQL & " CBankAccNo = '" & p_accno & "', CBankMICRNo = '" & p_micrno & "', "strSQL = strSQL & " CPV = '" & p_pv & "' "strSQL = strSQL & " WHERE ClientId = '"& p_id"'"RunSQL (strSQL)end functionsince i want to modify db using cid...but it gives error...I guess some problem with p_id." |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-08-23 : 09:43:09
|
| Give the table structure,U may have a field (like CPV, ClientID ...), which is of numeric type and ur update query is assuming all as character (by sorrounding with quotes)Also the way that u r doing is not the recommended. U should use a stored proc.Srinika |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-08-26 : 05:11:05
|
| Also, always use stored procedure with input parameters. Avoid having Concatenated strings in Front end applicationMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|