🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
1 messages
1 total messages Started by Maurice Anderson Sat, 14 Apr 2007 20:26
API Ado Events (not AdoExpress)
#155
Author: Maurice Anderson
Date: Sat, 14 Apr 2007 20:26
44 lines
2200 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads