Unanswered: ODBC ASE Driver v4.1 and RowsAffected / NOCOUNT query.. Help...
Hi there, just joined the forum so if I should be posting this in another area then please excuse me and do let me know where....
I have an issue concerning the ASE ODBC DriversV4.1 on a Sybase 11.9.2 / 12 dB.
When using the drivers through a connection object created in VB I am unable to obtain the RowsAffected on any tables that have Insert/Update triggers working on. I have tried setting the NOCUNT property but have realised that the Update/insert succeeds but the trigger itself does not seem to have fired for those update/inserts.
Has anybody come across this or know where I can look to resolve this... If anyone would like to look at the trigger then 'm happy to forward it on.
Originally posted by rnealejr
Have you been successful before using this driver and returning row affected (exactly like you are doing now) ? Have you tested creating a database/table without triggers to see if it works ?
Let me know - I might have a solution.
Thanks for your reply, I've not been successful at at with getting back the RowsAff with this driver connecting to tables with triggers.
Tables without triggers are fine, they return the Rowsaff as expected.
Add select @@rowcount at the end of your query. In your code, create a recordset object. When you run this query, 2 recordsets will be returned - the 2nd being the value you are looking for. Move to the 2nd recordset and use the rs(0) to return the value. Let me know how it goes.