Wrox Programmer Forums
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2003, 03:02 AM
AST AST is offline
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADO Execute !!HELP!!


Hi,

any ideas ?

I have tried to get an information about
affected rows by an SQL Statement.

Dim lngRowsAffected As Long

If cnS44B6573.State = 1 Then
    cnS44B6573.Execute strSQL, lngRowsAffected, adCmdText
End If

strSQL is something like
UPDATE TABLE SET FIELD = 5

The statement is processed accurate but
lngRowsAffected is always -1 !?

Using:

VB6, VisualStudio, ADOx 2.6, MDAC2.6, MS JET 4.0, IBM AS/400 OLE DB Provider, AS/400 (DB2) V5R1

 
Old August 7th, 2003, 08:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had a similar problem once with the record count using ADO. What it came down to was I was using a Server Side Cursor. Just off the top of my head, I would ensure you are using a Client Side Cursor and see what the results are.

Larry Asher
 
Old August 10th, 2003, 08:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Be sure that SET NOCOUNT ON has not been executed by any prior statements on the connection.

Be sure that the provider (AS/400) has not set this option behind your back...

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old November 13th, 2003, 03:56 PM
AST AST is offline
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

..dada..

I used Option:

adExecuteNoRecords

and it works

:o)

Quote:
quote:Originally posted by AST


Hi,

any ideas ?

I have tried to get an information about
affected rows by an SQL Statement.

Dim lngRowsAffected As Long

If cnS44B6573.State = 1 Then
    cnS44B6573.Execute strSQL, lngRowsAffected, adCmdText
End If

strSQL is something like
UPDATE TABLE SET FIELD = 5

The statement is processed accurate but
lngRowsAffected is always -1 !?

Using:

VB6, VisualStudio, ADOx 2.6, MDAC2.6, MS JET 4.0, IBM AS/400 OLE DB Provider, AS/400 (DB2) V5R1






Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between ADO and ADO.NET rakeshclose2u ADO.NET 2 April 23rd, 2007 03:57 AM
connection.execute and command.execute difference vinod_yadav1919 Classic ASP Databases 0 September 28th, 2005 06:34 AM
conn.execute,command.execute or rs.open vinod_yadav1919 Crystal Reports 0 January 3rd, 2005 10:26 AM
ADO AND ADO.NET royalsurej ADO.NET 1 November 8th, 2004 08:28 AM
ADO could ADO counot find the specified provider. Rob Collie Classic ASP Databases 2 June 9th, 2003 04:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.