Anybody know what I can do to fix this error. I'm lost.
Microsoft OLE DB Provider for SQL Server error '80040e07'
Disallowed implicit conversion from data type varchar to data type money, table 'brassin-dev.dbo.jobs', column 'hourly'. Use the CONVERT function to run this query.
/aspemployer/postjob.asp, line 123
LINE 123 is the last line of this code.
<!--#INCLUDE FILE="employer_secure.asp" -->
<!--#INCLUDE VIRTUAL="/templates/header.asp" -->
<%
Dim jobnumber, number, company, contname, conttitle, city, state, zip, country, phone
Dim fax, email, category, title, lastupdated, expiration, invoice, description
Dim datepaid, jobsposted, website, level, mode, rs, q, formaction, button, body, price
Dim hourly, yearly, perdiem, duration, projectstatus, sqlstartdate, sqlenddate, applybyemail%>
<!--#INCLUDE VIRTUAL="/_private/string.asp" -->
<!--#INCLUDE VIRTUAL="/_private/statestr.asp" -->
<!--#INCLUDE VIRTUAL="/_private/filefunctions.asp" -->
<!--#INCLUDE VIRTUAL="/_private/sendemail.asp" --><%
Sub getformaction()
if jobsposted = 0 then
Select Case Application("aryweb")(41, 0)
Case 1
formaction = "an/processorder.asp?prod=job&number=" & number
Case 2
formaction = "ib/processorder.asp?prod=job&number=" & number
Case 3
formaction = "cc/processorder.asp?prod=job&number=" & number
End Select
end if
End Sub
Sub getform
jobnumber = Request.Form("jobnumber")
number = Request.QueryString("number")
company = Request.Form("company")
contname = Request.Form("contname")
conttitle = Request.Form("conttitle")
city = Request.Form("city")
state = Request.Form("state")
zip = Request.Form("zip")
country = Request.Form("country")
phone = Request.Form("phone")
fax = Request.Form("fax")
email = Request.Form("email")
category = Request.Form("category")
title = Request.Form("title")
lastupdated = Request.Form("lastupdated")
expiration = Request.Form("expiration")
invoice = Request.Form("invoice")
description = Request.Form("description")
website = Request.Form("website")
level = Request.Form("level")
jobsposted = CInt(Request.Form("jobsposted"))
applybyemail = Request.Form("applybyemail")
if (applybyemail = "") OR (applybyemail = "0") then
applybyemail = 0
else
applybyemail = 1
end if
projectstatus = Request.Form("projectstatus")
startdate = Request.Form("startdate")
if NOT IsDate(startdate) then
sqlstartdate = "NULL"
else
sqlstartdate = "'" & startdate & "'"
end if
enddate = Request.Form("enddate")
if NOT IsDate(enddate) then
sqlenddate = "NULL "
else
sqlenddate = "'" & enddate & "'"
end if
hourly = Replace(Request.Form("hourly"), ",", "")
if hourly = "" then hourly = "0"
perdiem = Replace(Request.Form("perdiem"), ",", "")
if perdiem = "" then perdiem = "0"
yearly = Replace(Request.Form("yearly"), ",", "")
if yearly = "" then yearly = "0"
duration = Request.Form("duration")
End Sub
Sub getemployer()
q = "SELECT company, contname, conttitle, address, city, state, zip, country, phone, " &_
"fax, email, website, level_, datepaid, jobsposted, invoice, description " &_
"FROM employers WHERE number = " & number
openconn
Set rs = cn.Execute(q)
company = rs("company").Value
contname = rs("contname").Value
conttitle = rs("conttitle").Value
city = rs("city").Value
state = rs("state").Value
zip = rs("zip").Value
country = rs("country").Value
phone = rs("phone").Value
fax = rs("fax").Value
email = rs("email").Value
website = rs("website").Value
level = rs("level_").Value
datepaid = rs("datepaid").Value
jobsposted = rs("jobsposted").Value
invoice = rs("invoice").Value
if invoice > 0 then invoice = 1
rs.Close
Set rs = Nothing
closeconn
getformaction
button = "Add"
end Sub
mode = Request("mode")
formaction = "postjob.asp"
element1 = "Select at Least One"
Select Case mode
Case "insert"
getform
expiration = Application("aryweb")(26, 0)
q = "INSERT INTO jobs (password, company, contname, conttitle, city, state, zip, country, " &_
"phone, fax, email, category, title, expiration, invoice, description, hourly, yearly, perdiem, duration, projectstatus, " &_
"startdate, enddate, applybyemail)" &_
"VALUES(" & number & ", '" & sqlstr(company) & "', '" & sqlstr(contname) &_
"', '" & sqlstr(conttitle) & "', '" & sqlstr(city) & "', '" & statestr(state) &_
"', '" & zip & "', '" & country & "', '" & phone & "', '" & fax & "', '" & email & "', '" &_
sqlstr(category) & "', '" & sqlstr(title) & "', '" & sqlstr(hourly) & "', '" & sqlstr(yearly) & "', '" & sqlstr(perdiem) &_
"', '" & sqlstr(duration) & "', '" & sqlstr(projectstatus) & "', '" & sqlstr(startdate) & "', '" & sqlstr(enddate) &_
"', '" & sqlstr(applybyemail) & "', '" & expiration &"', '" & invoice & "', '" & sqlstr(description) & "')"
openconn
cn.Execute(q)
'Surround your mind and you shall see a great future ahead'
Shane B.