?
Solved

Events using ENUM paremeters in Access97

Posted on 2003-03-06
2
Medium Priority
?
252 Views
Last Modified: 2012-06-27
Setup: NT, Access97, ADO2.6
I'm trying to use the ADO Events on the connection object (declared using the WithEvents Keyword)

My dilemma: when I properly declare an event such as...
Private Sub Con_Disconnect(adStatus As ADODB.EventStatusEnum, pConnection As ADODB.Connection)
End Sub

I get an error "Type not supported in Visual Basic"

on the other side, when I try to change the event declaration to a LONG data type instad of the EventStatusEnum (which I know is not supported in access 97), I get the error "Event procedure declaration doesn't match description of event having same name"

is there a workaround, or is it just not possible to use events that contain enumerated parameters in A97?
0
Comment
Question by:zorkym
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
LambertHeenan earned 600 total points
ID: 8082040
So you have a class with something like

Private WithEvents Con As ADODB.Connection

and then you need to define the event handler for the Disconnect event, yes?

In which case I do believe that you are stuck. The ADO type library defines the various event handlers and their parameters, and so it insists that the Disconnect event uses an Enum type parameter, which VBA in A97 simply does not support. This is not even one of those cases where you can fake an Enum by defining a bunch of constant values.

;-(
0
 

Author Comment

by:zorkym
ID: 8237053
not the answer I like, but I think it's correct.
thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question