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)
 sql-asp to sql conversion error

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-08-12 : 08:27:52
may writes "Hi expert
I am using asp page to insert data to sql server.

rssavedata.Open "INSERT into timesheet(" & _
"proj_eng," & _
"proj_week, " & _
"proj_year, " & _
"proj_id," & _
"proj_hr," & _
"proj_des," & _
"sub_date)" & _
"values (" & "'" & _
struser & "','" & _
strweek & "','" & _
stryear & "','" & _
strpro & "','" & _
strhour & "','" & _
strdes & "','" & _
stdate & "')"

proj_week,proj_year,proj_hr is declared as numeric.
------------------------------------------------
error.message

Microsoft OLE DB Provider for SQL Server (0x80040E07)
Error converting data type varchar to numeric.
/project/taskeng.asp, line 22

Is there any advice?"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-08-12 : 08:30:10
Numeric values must not be delimited with single quotes ('):

rssavedata.Open "INSERT into timesheet(" & _
"proj_eng," & _
"proj_week, " & _
"proj_year, " & _
"proj_id," & _
"proj_hr," & _
"proj_des," & _
"sub_date)" & _
"values (" & "'" & _
struser & "', " & _
strweek & " , " & _
stryear & " ,'" & _
strpro & "', " & _
strhour & " ,'" & _

strdes & "','" & _
stdate & "')"


Go to Top of Page
   

- Advertisement -