Help resolving ODBC error
am 02.01.2007 19:30:02 von sbnorgTo whom it may concern,
I placed the question below on MySql and Wrox forums and no one has replied. I
came across this list so thought I'd try it too. Yesterday I debugged the
decimal content and a conversion of "20D" was put in that parameter. The value
is "20.00" representing $20. It's the decimal processing only where the error
occurs. Previous conversions/assignments for the integers and date were
successful. The way the error reads it seems like the problem might be in the
driver in the execution of the command since the data seems to be okay.
With the code below I get "ERROR[07006]...Restricted data type attribute
violation (SQL_C_NUMERIC)" when the query is executed. There is no mention of
this SQLSTATE error in the MySQL documentation of Appendix C.1 (server) or C.2
(client).
Dim strSQLSchedule As String = "INSERT INTO schedule " & _
"(crsno,sesno,schdate,cost) VALUES (?,?,?,?);"
Dim cmdSchedule As New OdbcCommand(strSQLSchedule, cnAqua)
With cmdSchedule.Parameters
.Add("?", OdbcType.SmallInt).Value = Convert.ToInt16(crsnum.Value)
.Add("?", OdbcType.SmallInt).Value = Convert.ToInt16(sesnum.Value)
.Add("?", OdbcType.DateTime).Value = Convert.ToDateTime(schedte.Value)
.Add("?", OdbcType.Decimal).Value = Convert.ToDecimal(costof.Value)
End With
cmdSchedule.ExecuteNonQuery()
Thanks for the help.
Bruce
--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org