keybd_event versus SendKeys to open Access database with macros disabled

P

Paul Martin

Hi all

I am wanting to programmatically open an Access database with macros
disabled (equivalent to opening with Shift key pressed). I have seen
code for both keybd_event and SendKeys and am wondering what is the
difference. I have heard that SendKeys is a method of 'last resort'.
Can anyone enlighten me?

Thanks in advance

Paul Martin
Melbourne, Australia
 
T

Tom Ogilvy

Most would recommend automation if you actually need to open the Access
application. to do your work. If you just need to work with the data, you
may not need to open access.

Sendkeys simulates typing at the Keyboard. Naturally, how those keystrokes
are interpreted would depend on the environment at the time. I am not sure
on the keybd_event, but would suspect it has something to do with using the
Windows API to stuff keystrokes in the keyboard buffer. The effect would
be the same.

http://support.microsoft.com/?id=167223
OFF97: Microsoft Office 97 Automation Help File Available (Q167223)

http://support.microsoft.com/?id=260410
OFF2000: Microsoft Office 2000 Automation Help File Available (Q260410)

accessing the data directly:
DAO/ADO
http://www.erlandsendata.no/english/index.php?t=envbadac
 
P

Paul Martin

Tom

Thanks for the reply. I may write my app in Excel or possibly VB6.
I'm not interested in the data at all. I need to analyse different
components of the .MDB file like system tables, macros, queries, etc
for drive letter paths, use of DSNs and use of non-standard Reference
Libraries (DLLs). If I write the app in Excel, it will write details
to a worksheet. If in VB6, I'll probably write to a text file and open
in Excel.

I am just looking at the best way to open an Access database with
macros disabled, equivalent to pressing the Shift key.

Paul
 
T

Tom Ogilvy

You might want to post in an access newgroup if you want to know about
Access properties and methods.

Automation would probably be the way to go.
 

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