# Automating Access

**URL:** <https://www.ruby-forum.com/t/automating-access/62667>\
**Category:** Ruby\
**Created:** [June 7, 2006, 4:30am UTC](https://www.ruby-forum.com/t/automating-access/62667 "2006-06-07T04:30:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warren\_Dowling](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@Warren\_Dowling](https://www.ruby-forum.com/u/Warren_Dowling)\
**Post date:** [June 7, 2006, 4:30am UTC](https://www.ruby-forum.com/t/automating-access/62667/1 "2006-06-07T04:30:55Z")

</div>

Hi,

I’m currently working with the WIN32OLE object in an attempt to create a  
test framework for the automation testing (mostly regression) of an  
access  
database that we have written. I am having great difficulty in  
identifying  
how to get hold of the event sink for either access or the forms that  
are  
being displayed. Would anyone know if there is one and if so what it’s  
called/how to get it.

I’ve tried a variety of things but the …\_EVENT.new(@TMWin) fails, with  
an  
‘interface not found’ or ‘No Such Interface supported’ error message

The code I’ve got so far looks like this:

```
@TMWin = WIN32OLE.new("ACCESS.Application")
@TMWin.visible = true
@TMWin.OpenCurrentDatabase 

```

“c:\TM-Testing\2000-TMInterface5.1.3.mdb”  
ev=WIN32OLE\_EVENT.new(@TMWin)  
ev.on\_event {|\*args| puts’here’}

# ev.on\_event(“quit”) {thow:done}

```
catch(:done) do
  loop do
    WIN32OLE_EVENT.message_loop
  end#loop
end#catch

```

end#def

Thanks for your help

Warren

* * *

Warren Dowling

Test Engineer

T: +61 (07) 38396346  
M: +61 (0)405 227 661  
F: +61 (07) 5522 5232 HYPERLINK  
"[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)"removed\_email\_address@domain.invalid

Level 6, 131 Leichhardt St  
Spring Hill  
Qld 4000

* * *

HYPERLINK "[http://www.kjross.com.au/](http://www.kjross.com.au/)"K.J.Ross & Associates

* * *

This document (including attachments) is only intended for its  
addressee/s  
and may contain privileged or confidential information. Unauthorised use  
or  
distribution of this document or any part of its contents, is  
prohibited. If  
you have received this email in error please notify the sender and  
delete  
the email immediately.
