Passing Numeric into Tinyint field (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


sentinel -> Passing Numeric into Tinyint field (3/28/2008 15:16:46)

hey all....

I am using the following code to try to pass a numeric value into a TINYINT field in Mysql 5.

"INSERT INTO ot (ot1,ot2,ot3,UserID,DateEntered,OTHours1,OTHours2,OTHours3) VALUES ('" & request.form("ot1") & "','" & request.form("ot2") & "','" & request.form("ot3") & "', '" & user & "',curdate(),'" & request.form("OTHours1") & "','" & request.form("OTHours2") & "','" & request.form("OTHours3") & "')"


I receive this error:

Database Results Error
Description: [MySQL][ODBC 3.51 Driver][mysqld-5.0.51a-community-nt]Incorrect integer value: '' for column 'OTHours1' at row 1
Number: -2147467259 (0x80004005)
Source: Microsoft OLE DB Provider for ODBC Drivers

Am i trying to insert the OTHours1 using the wrong format or something? I can add values manually from command line but not using the SQL code.

Thanks




rdouglass -> RE: Passing Numeric into Tinyint field (3/28/2008 15:41:11)

quote:

,'" & request.form("OTHours1") & "',


Try getting rid of those apostrophes. None when using numeric values.

...," & request.form("OTHours1") & "," & request.form("OTHours2") & ",...

That help any?




sentinel -> RE: Passing Numeric into Tinyint field (3/28/2008 15:45:28)

Yes thank you very much!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
4.736328E-02