ADO events under Access 97

A

Archives

Hello,

Does anybody know how to use an ADO event under Access 97 ?

Since, we can't use the Enum type under Access 97, I try to replace
ADODB.EventStatusEnum by a Long type. So, I have this code:

Private Sub connEvent_ConnectComplete(ByVal pError As ADODB.Error, _
adStatus As Long, _
ByVal pConnection As ADODB.Connection)

But I get an error at the compilation. I checked this code under Access 2003
and all was fine.

Do you know how to code this event under Access 97 ?
 
A

Archives

Yes I did (version 2.7). All the ADO methods and properties are OK. I can
connect a database, read some recordset but I can't compile an event.
 
A

Alex Dybenko

have added a new class to access97, added following code there:

Private WithEvents objcon As ADODB.Connection

Private Sub objcon_ConnectComplete(ByVal pError As ADODB.Error, adStatus As
Long, ByVal pConnection As ADODB._Connection)
'ok
End Sub

class compiled ok at me, so looks ok for access 97.

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
 
A

Archives

On two differents PC, I can't compile.

"Declaration procedure doesn't match the event same name"
 
A

Alex Dybenko

probably you have different ADO versions?

to make sure you insert correct proc declaration - use 2 top combos of class
module window to add proc
 
A

Archives

I have tryed to use the two top combos. When I select an event in the right
combo, it creates all the event but with the sub line in red. It is because
it uses "ByVal pConnection As ADODB._Connection" as last parameter instead
of "ByVal pConnection As ADODB.Connection".

When I remove the "_", I get a black line but I can't compile. Always the
same warning message.

I have tryed with version from 2.0 to 2.7 without result.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top