Automating Access

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:[email protected]"[email protected]

Level 6, 131 Leichhardt St
Spring Hill
Qld 4000


HYPERLINK "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.