Problem updating Sql Server database from asp page

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,
I am building an asp application with sql server as backend.
I am building the sql string in the main processing page. With a
response.write
statement I get the sql statement. I am testing in Query Analyzer whether
this SQL statement is working. Sql Server does not update the table and sends
me an error message. I would appreciate some help on this. Thanks. Regards.

CODE:

strSQL1 = "UPDATE tblApplication SET tblApplication.ORI= '" & l_p_ORI
& "' " & _
", tblApplication.Agency= '" & l_p_Agency & "' " & _
", tblApplication.MaleSworn= '" & l_p_MaleSworn & "' " & _
", tblApplication.FemaleSworn= '" & l_p_FemaleSworn & "' " & _
", tblApplication.MaleCivilian= '" & l_p_MaleCivilian & "' " & _
", tblApplication.FemaleCivilian= '" & l_p_FemaleCivilian & "' " & _
", tblApplication.Detention= '" & l_p_Detention & "' " & _
", tblApplication.SchoolResource= '" & l_p_SchoolResource & "' " & _
", tblApplication.HaveReserve= '" & l_p_HaveReserve & "' " & _
", tblApplication.Reserve= '" & l_p_Reserve & "' " & _
", tblApplication.HavePTSworn= '" & l_p_HavePTSworn & "' " & _
", tblApplication.PTSworn= '" & l_p_PTSworn& "' " & _
", tblApplication.FTCourtSecurityOfficer= '" &
l_p_FTCourtSecurityOfficer & "' " & _
", tblApplication.OfficerStartingSalary= '" &
l_p_OfficerStartingSalary & "' " & _
", tblApplication.HasDispatchCenter= '" & l_p_HasDispatchCenter &
"' " & _
", tblApplication.WhatKindDispatchCenter= '" &
l_p_WhatKindOfDispatchCenter & "' " & _
" where " & _
" tblApplication.ApplicantIntID= " & ApplicantIntID & ";"


Response.Write "<br>"
Response.Write strSQL1
Response.Write "<br>"

SQL STATEMENT GENERATED:


UPDATE tblApplication SET tblApplication.ORI= '00000000007' ,
tblApplication.Agency= 'TestingAgency' , tblApplication.MaleSworn= '21' ,
tblApplication.FemaleSworn= '18' , tblApplication.MaleCivilian= '55' ,
tblApplication.FemaleCivilian= '29' , tblApplication.Detention= '79' ,
tblApplication.SchoolResource= '24' , tblApplication.HaveReserve= 'Y' ,
tblApplication.Reserve= '14' , tblApplication.HavePTSworn= 'Y' ,
tblApplication.PTSworn= '21' , tblApplication.FTCourtSecurityOfficer= '23' ,
tblApplication.OfficerStartingSalary= '$2,500.55' ,
tblApplication.HasDispatchCenter= 'Y' ,
tblApplication.WhatKindDispatchCenter= 'This is a test disp' where
tblApplication.ApplicantIntID= 70;


ERROR REPORT FROM SQL SERVER:

Disallowed implicit conversion from data type varchar to data type money,
table 'manpowerweb.dbo.tblApplication', column 'OfficerStartingSalary'. Use
the CONVERT function to run this query.
.



Relevant Pages

  • Re: SQL Adaptor - Timeout
    ... Anyway there is not many methods to throttling: ... SQL send port trying to repeat the SP several times then suspend the ... Server stored procedures using SQL Server Adaptor. ... The adapter "SQL" raised an error message. ...
    (microsoft.public.biztalk.general)
  • Re: SQL Timeout Error
    ... "Robert Lakinski" wrote: ... but you can access data in Sql server via MS ... I don't know why I got the error message. ...
    (microsoft.public.sqlserver.server)
  • Re: Access 2007->SQL Server2005 "connection was forcibly closed",G
    ... I moved every table I was able to move to the SQL ... closed connections - but all of these errors are in the version which used ... the SQL Server 2000 and everything worked ... communication between ODBC (OLEDB and Native Client, ...
    (microsoft.public.sqlserver.connect)
  • Re: update query ODBC--call failed
    ... Google results from searching for your error message, ... on the local server SQL database. ... reporting the error rather than the "ODbc Driver For SQL Server" ...
    (microsoft.public.access.queries)
  • Re: Problem upgrading Microsoft Office Accounting Professional from 2008 to 2009 using SQL Express 2
    ... The file that is attached to the "Open a Company" command is a text document that appears to just contain the connection string for the selected company. ... Server Express Edition locally, but cannot connect remotely, and if the SQL Server Express Edition is listening on Named Pipes, then I suspect a firewall issue on the computer that is running SQL Server Express Edition. ... Since the problem appears to involve some sort of interaction between Microsoft Office Accounting Professionaland SQL Express 2008 hopefully someone in this forum will understand the error message I'm receiving and can suggest some possible solutions for me to try. ...
    (microsoft.public.sqlserver.connect)