Recording and playback keys

J

John

Hi

I need to setup a recorder for keystrokes typed in a field. Afterwards I
need to playback the keystrokes back to the field. I need to know;

1. What event I can use to capture the keystrokes?

2. What type of file I can store the keystroke in?

3. How can I play keystrokes back to a field i.e. make it so field thinks
that keystrokes are being typed into it?

Thanks

Regards
 
A

Allen Browne

John there's a range of legal and moral questions in regard to creating a
key-logger program and installing it on computers. I'm not sure you'll get
that kind of help here. But you probably knew that.
 
D

Dirk Goldgar

John said:
Hi

I need to setup a recorder for keystrokes typed in a field. Afterwards I
need to playback the keystrokes back to the field. I need to know;

1. What event I can use to capture the keystrokes?

2. What type of file I can store the keystroke in?

3. How can I play keystrokes back to a field i.e. make it so field thinks
that keystrokes are being typed into it?


This is an odd request. The control knows and records what characters were
typed into it. And you can set the value of a control just by assigning a
character string or numeric value to it. What exactly are you trying to
accomplish here? It sure does sound like an attempt at a key logger. If
you're trying to set up an audit record of some sort, you wouldn't normally
do it by recording individual keystrokes.
 
J

John

Hi Dirk

I am really trying to do a real-time backup of sensitive and very important
fields. For space saving reasons instead of saving the whole field on update
it seems better to record keystrokes and play them back (to the point we
need) when field restoration is required.

Thanks

Regards
 
J

John

Allen, if I need a key-logger, there are plenty out there. :)

Its really for real time backup of some important fields. Some fields lost
important information during the day i.e. between the two nightly backups
and client do not wish this repeated so I am wondering if some sort of
real-time backup that gets deleted every day once nightly backup is done
would do.

Thanks

Regards
 
A

Allen Browne

In that case, I would suggest you use the BeforeUpdate event procedure of
the form to record exactly what each field was at the time the entry was
saved. This saves not only new entries and edits of existing entries, but
also a copy of any record that gets deleted.

Here's how to use the form's events to do that:
Audit Trail - Log changes at the record level
at:
http://allenbrowne.com/AppAudit.html

Of course, you will want your audit table in another database to meet your
design goal of keeping it separate from the actual data.
 
D

Dirk Goldgar

John said:
Hi Dirk

I am really trying to do a real-time backup of sensitive and very
important fields. For space saving reasons instead of saving the whole
field on update it seems better to record keystrokes and play them back
(to the point we need) when field restoration is required.


I don't see how you would save significant space, especially since you would
need to record mouse actions as well. Unless you have a very restrictive
application, I think your proposed approach is likely to be more trouble
than it's worth.

To answer your technical question, forms and many controls have KeyDown,
KeyUp, and KeyPress events, in which you can determine what key or key
combination was pressed. The help file can assist you with the technical
details of these events.

The SendKeys statement can send keystrokes to the active window, but it is
(or at least has been in the past) sufficiently buggy that we generally
recommend people not use it. This link provides an API-based replacement
for SendKeys, but it's still a problematic approach, for reasons that are
described in the article:

http://www.mvps.org/access/api/api0046.htm
 

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