BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: How Can I tell which DataSource?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Daryl
Guest





PostPosted: Sat Apr 10, 2004 9:30 pm    Post subject: Re: How Can I tell which DataSource? Reply with quote



Try the following techniques, I have written them off the top of my head so
check before use...

if (DataSet->Name == "dsSport") {
// Do what ever...
}

sometimes you may have to do a dynamic_cast if the method has Sender as the
passed variable. Use the following to make sure Sender can be cast to what
you are expecting.

TADODataSet d*;
if ((d = dynamic_cast<TADODataSet*> (Sender)) == NULL) {
return
}

// Then use d as you see fit.

if (d->Name == "dsTeam") {
// Manage dsTeam
}
else if (d->Name == "dsSport") {
// Manage dsSport
}

"Claude" <claude (AT) dev (DOT) scomage.com> wrote

Quote:
I have a DataModule with seven DataSource. Two of which are: Sport and
Team

I want to write ONE Event (AfterGetRecords) that Sport, Team and the
others
use to display the record count. I don't want to write seven
AfterGetRecords.

How do I tell which DataSource was used?





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.