Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
Help resolving ODBC error

Help resolving ODBC error

2007-01-02       - By sbnorg@(protected)

 Back
To 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=mysql@(protected)