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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 hi..Sql error

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 strSQL
strSQL = " 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 function
since 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
Go to Top of Page

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 application

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -