• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 29. Handling Events with VBA 6.0 > In the Real World—Dealing with Event...

In the Real World—Dealing with Event-Driven Programming

Beginning programmers and Web page designers often find that understanding Windows'event-driven programming model to be quite difficult. The same problem befalls many programmers experienced in conventional procedural languages, such as assembly, COBOL, Pascal, and xBase. With a very few exceptions, VBA code in an Access application or script in a DHTML page executes only in response to a predefined event. (The primary exceptions are variable and Windows function prototype declarations that precede VBA subprocedure and function code in modules.)

The first Office data object model that offered events was Access 97's ODBCDirect, an object wrapper over Visual Basic 4.0 Enterprise Edition's Remote Data Object (RDO) 1.0. Being able to intercept data-related events, such as when making a connection or starting and ending query execution, enables you to handle connection errors and asynchronous data operations. An asynchronous data operation is one in which control returns to your program after query execution starts. When the query completes, the corresponding event lets you write code to process the resulting Recordset. Your application isn't in a state of suspended animation while waiting for a “query from hell” to complete.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint