Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASE ODBC Drivers V4.1 and RowsAffected.... help pls....

Status
Not open for further replies.

RocksLondon

Programmer
Sep 19, 2002
4
US

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.

Any help/Advice would be very appreciated.

Kind regards,
 
I've never worked with VB, but I've used ODBC with Sybase on the systems in question and the applications don't have any trouble getting and displaying number of rows affected.

I'm guessing "NOCUNT" is a slightly mistyped "NOCOUNT" as in:

set nocount on
/* some query here */
set nocount off

I can't think of any way that nocount could affect whether a trigger fires or not. That doesn't accord with my experience or make any logical sense. But, that said, you should be able to get the value you need with an explicit select:

/* do your query */
select @@rowcount as "rows_affected"


It may be that the ODBC driver doesn't fully implement something that's needed for returning the value in RowsAffected (which I'm not familiar with--ODBC's not my choice for my own coding so I'm not sure whether this is some attribute of the SQL object you can look at after a query or what). But, there are third party ODBC drivers if you need them. The one that comes free with Sybase is rather old and almost certainly has some limitations. However, when I use the freebie ODBC driver underneath WinSQL (from what used to be called Indus-soft), it tells me the number of rows affected without any difficulty.

Sorry not to be more help, try the select on @@rowcount and see what you get.

Best of luck,

JMC J M Craig
Alpha-G Consulting, LLC
nsjmcraig@netscape.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top