Previous Thread

8/7/2006 11:33:46 PM    when does the provider go to the DB. Just on calling Execute?
Hi, 
 
I would like to know when the consumer access the DB. Is it just when 
 
using ICommandText::Execute or could be other methods ? 
 
Thanks, 
 
Gilad.



8/8/2006 8:44:20 AM    Re: when does the provider go to the DB. Just on calling Execute?
It's provider-specific and also depends on what interface the client 
 
requests and which methods it calls, but the provider does have to support 
 
the base OLE DB interfaces. So, unless all of the metadata that a data 
 
source provides (think INFORMATION_SCHEMA info) is static and hard-coded 
 
into the provider, it will be more often than ICommand::Execute. Or, on 
 
ICommand::Execute and at connect time it will be doing more than just 
 
connecting to the database and executing the command. Look at the OLE DB 
 
property sets or IColumnsInfo/IColumnsRowset and others and figure out how a 
 
provider would obtain that information. 
 
Cheers, hope this helps, 
 
Bob Beauchemin 
 
http://www.SQLskills.com/blogs/bobb 
 
"gilad" <giladv@yahoo.com> wrote in message 
 
news:1155018826.545822.198360@m73g2000cwd.googlegroups.com...

8/9/2006 7:14:50 AM    Re: when does the provider go to the DB. Just on calling Execute?
The connect time does not bother me, just processing queries. Are you 
 
saying that IColumnsInfo::GetColumnInfo goes to the DB to get the info 
 
or is it in IRowset that was returned using: 
 
pICommandText->Execute(NULL, IID_IRowset, NULL,       &cRowsAffected, 
 
(IUnknown**) &pIRowset) 
 
Thanks, 
 
Gilad. 
 
Bob Beauchemin wrote:

8/9/2006 11:21:50 AM    Re: when does the provider go to the DB. Just on calling Execute?
Hi Gilad, 
 
It doesn't necessarily go "back" to the DB, it might execute other queries 
 
to get additional metadata while its there. If the application requests it. 
 
If you're client calls IColumnsRowset::GetColumnsRowset later on (and 
 
doesn't request it in the Command Properties "up front") you may see 
 
additional round trips. Most clients that want IColumnsRowset request it up 
 
front, and then the metadata request is piggybacked with the execute. 
 
Cheers, 
 
Bob Beauchemin 
 
http://www.SQLskills.com/blogs/bobb 
 
"gilad" <giladv@yahoo.com> wrote in message 
 
news:1155132890.334801.296110@m73g2000cwd.googlegroups.com...