dbTalk Databases Forums  

Knowing number of affected rows

comp.databases.mysql comp.databases.mysql


Discuss Knowing number of affected rows in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Yo
 
Posts: n/a

Default Knowing number of affected rows - 10-25-2010 , 09:19 AM






Hello,

I'm working on an application in C++ using a MySQL 5 database with ADO
connection.

I send an UPDATE query and I'd like to know how many rows where
affected by the command. I heard about a mysql_affected_rows() function
for this purpose, but when I try to use it, it is not recognized by my
C++ compiler.

Is there a way to know the affected rows number by accessing some
information from the ADO objects, like :

ado20::_RecordsetPtr pRec = NULL;
ado20::_ConnectionPtr pCon = NULL;

Thankk you for your help.

Reply With Quote
  #2  
Old   
The Natural Philosopher
 
Posts: n/a

Default Re: Knowing number of affected rows - 10-25-2010 , 09:33 AM






Yo wrote:
Quote:
Hello,

I'm working on an application in C++ using a MySQL 5 database with ADO
connection.

I send an UPDATE query and I'd like to know how many rows where affected
by the command. I heard about a mysql_affected_rows() function for this
purpose, but when I try to use it, it is not recognized by my C++ compiler.

What exactly do you mean by that?

If the correct header file is is not #include-d, the compiler might get
irritable about it's or it's parameters definition, but it can not
recognise it, since you have implicitly declared it..

If you don't link with the mysql C API library, the linker will get
irritable of course.

Reply With Quote
  #3  
Old   
Yo
 
Posts: n/a

Default Re: Knowing number of affected rows - 10-25-2010 , 09:45 AM



The Natural Philosopher a utilisé son clavier pour écrire :
Quote:
Yo wrote:
Hello,

I'm working on an application in C++ using a MySQL 5 database with ADO
connection.

I send an UPDATE query and I'd like to know how many rows where affected by
the command. I heard about a mysql_affected_rows() function for this
purpose, but when I try to use it, it is not recognized by my C++ compiler.

What exactly do you mean by that?

If you don't link with the mysql C API library, the linker will get irritable
of course.
Thanks. So is there another way (rather than linking with mysql C API
and using mysql_affected-rows()) to know how many rows were affected by
my query ?

Reply With Quote
  #4  
Old   
Peter H. Coffin
 
Posts: n/a

Default Re: Knowing number of affected rows - 10-25-2010 , 09:55 AM



On Mon, 25 Oct 2010 16:19:18 +0200, Yo wrote:
Quote:
Hello,

I'm working on an application in C++ using a MySQL 5 database with ADO
connection.

I send an UPDATE query and I'd like to know how many rows where
affected by the command. I heard about a mysql_affected_rows() function
for this purpose, but when I try to use it, it is not recognized by my
C++ compiler.

Is there a way to know the affected rows number by accessing some
information from the ADO objects, like :

ado20::_RecordsetPtr pRec = NULL;
ado20::_ConnectionPtr pCon = NULL;

Thankk you for your help.
If you're using ADO to managed the connection and execute the query,
you'll have to use ADO to get the number of affected rows. One always
has to stay within the framework...

http://dev.mysql.com/doc/refman/5.0/...-microsoft-ado

--
"Doesn't everybody?" is a question that never expects an answer of "No."

Reply With Quote
  #5  
Old   
The Natural Philosopher
 
Posts: n/a

Default Re: Knowing number of affected rows - 10-25-2010 , 10:23 AM



Yo wrote:
Quote:
The Natural Philosopher a utilisé son clavier pour écrire :
Yo wrote:
Hello,

I'm working on an application in C++ using a MySQL 5 database with
ADO connection.

I send an UPDATE query and I'd like to know how many rows where
affected by the command. I heard about a mysql_affected_rows()
function for this purpose, but when I try to use it, it is not
recognized by my C++ compiler.

What exactly do you mean by that?

If you don't link with the mysql C API library, the linker will get
irritable of course.

Thanks. So is there another way (rather than linking with mysql C API
and using mysql_affected-rows()) to know how many rows were affected by
my query ?


Not that I know of. My problem is that I cant see why it wont work, and
you didn't tell me any more than the last post.

If you don't have the mysql C++ and/or C API library you have no way to
access mysql database, so basically no sql access will work.

Reply With Quote
  #6  
Old   
The Natural Philosopher
 
Posts: n/a

Default Re: Knowing number of affected rows - 10-25-2010 , 10:25 AM



Peter H. Coffin wrote:
Quote:
On Mon, 25 Oct 2010 16:19:18 +0200, Yo wrote:
Hello,

I'm working on an application in C++ using a MySQL 5 database with ADO
connection.

I send an UPDATE query and I'd like to know how many rows where
affected by the command. I heard about a mysql_affected_rows() function
for this purpose, but when I try to use it, it is not recognized by my
C++ compiler.

Is there a way to know the affected rows number by accessing some
information from the ADO objects, like :

ado20::_RecordsetPtr pRec = NULL;
ado20::_ConnectionPtr pCon = NULL;

Thankk you for your help.

If you're using ADO to managed the connection and execute the query,
you'll have to use ADO to get the number of affected rows. One always
has to stay within the framework...

http://dev.mysql.com/doc/refman/5.0/...-microsoft-ado

aah...

I missed the ADO bit. All becomes clear.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.