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 

API Ado Events (not AdoExpress)

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Maurice Anderson
Guest





PostPosted: Fri Apr 13, 2007 8:34 pm    Post subject: API Ado Events (not AdoExpress) Reply with quote



I am not usung AdoExpress.

I have some Ado code using the API which works good.

hr = CoCreateInstance(
CLSID_CADOConnection,
NULL,
CLSCTX_INPROC_SERVER,
IID_IADOConnection,
(LPVOID *)&piTmpConnection
);

hr = piTmpConnection->put_Provider(L"Microsoft.Jet.OLEDB.4.0");
piTmpConnection->put_Mode(adModeReadWrite);

if(FAILED(hr))
{
return status;
}

hr = piTmpConnection->Open(
WideString(FConnectionString), WideString(FUser),
WideString(FPassword),
adConnectUnspecified);

I also have a event handler; something like:

if( FOnConnect != NULL )
{
// call the handler
FOnConnect( this, GetErrorMessage(hr), hr, IntToHex((int)hr,
10));

}

Assume all the code snippet above works fine. I now want to use Ado Events
to fire when I connect and disconnect. msdn defines the events here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthcnnopen.asp

My question is, how do I implement the Events? How would I integrate them
into my evens handly system?

Thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) 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.