Despair :( - ODBC Behaves differently in COM+ Application [modified]
-
I have written a data access layer running under com+ Using the IBM Informix ODBC driver, I am able to select from a table with no problems, when I attempt to updtate the table, the error I receive is "Invalid string or buffer length" (all my googling seems to indicate that this message may have something to do with parameters) I have set up a test application that performs identical operations to the com+ app. These are: . Open Connection . Create a select command . Fill dataset adapter using select command and adapter . Alter 1 single field in a single row . Create an update command . Call adapter.update Now here's the weird thing. The test app works fine, the com+ app fails. When I compare the SQLTrace between the 2 applications. The test application which works, generates many, many more ODBC instructions than the failing com+ app. Each application is performing the identical workload through the same driver using the same the system.data.odbc objects. Does anybody have any ideas? I've been banging my head against this for a while now and have no idea what to try next. Much thanks. -- modified at 3:35 Wednesday 10th January, 2007
-
I have written a data access layer running under com+ Using the IBM Informix ODBC driver, I am able to select from a table with no problems, when I attempt to updtate the table, the error I receive is "Invalid string or buffer length" (all my googling seems to indicate that this message may have something to do with parameters) I have set up a test application that performs identical operations to the com+ app. These are: . Open Connection . Create a select command . Fill dataset adapter using select command and adapter . Alter 1 single field in a single row . Create an update command . Call adapter.update Now here's the weird thing. The test app works fine, the com+ app fails. When I compare the SQLTrace between the 2 applications. The test application which works, generates many, many more ODBC instructions than the failing com+ app. Each application is performing the identical workload through the same driver using the same the system.data.odbc objects. Does anybody have any ideas? I've been banging my head against this for a while now and have no idea what to try next. Much thanks. -- modified at 3:35 Wednesday 10th January, 2007
The bug was caused by me having only one pair of eyes. Adding another 2 eyes to the code revealed... That If you use the ODBCParameter object, and the sourceColumn property contains a leading space... Things don't work.