how to save info with timer

  • Thread starter Thread starter Miikka Hamalainen
  • Start date Start date
M

Miikka Hamalainen

Hi,

I'm trying to create tool to save information from linked oracle db with
Access.
I have created query and would like it to run on certain intervals.

How could I do this?

Br, Miikka
 
Miikka said:
Hi,

I'm trying to create tool to save information from linked oracle db with
Access.
I have created query and would like it to run on certain intervals.

How could I do this?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use a form (hidden, if you like [Visible = False]) that uses the OnTimer
event and Timer Interval. The timer interval is in milliseconds (1000 =
1 second). Set up the OnTimer event to run the query when the Timer
Interval hits you indicated time. E.g.: Say you want to the query to
run every 30 minutes you'd set the Timer Interval to 1800000 (1000 * 60
* 30). Then have an OnTimer event procedure like this:

Private Sub Form_Timer()

On Error GoTo err_

' Use DAO
CurrentDb.QueryDefs("query name").Execute dbFailOnError

exit_:
Exit Sub

err_:
MsgBox "Error: " & Err.Description

End Sub

Substitute your query name for "query name" in the QueryDefs().

The form must be open continuously for this scheme to work.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRKGQDoechKqOuFEgEQI65QCfbU2O/2AT++6R4Wh3rzo/VXF6HzEAoM/E
AgGdo9f7JwIlCE9JqkTv7sAs
=2W/4
-----END PGP SIGNATURE-----
 
I don't need to add anything to Form, like Timer Control (like in VB)?
Just write the code to Form?

When I do this Access asks to save macro.

Is there any way to save these timed query results? To give default
path and name.

/Miikka

MGFoster kirjoitti:
Miikka said:
Hi,

I'm trying to create tool to save information from linked oracle db with
Access.
I have created query and would like it to run on certain intervals.

How could I do this?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use a form (hidden, if you like [Visible = False]) that uses the OnTimer
event and Timer Interval. The timer interval is in milliseconds (1000 =
1 second). Set up the OnTimer event to run the query when the Timer
Interval hits you indicated time. E.g.: Say you want to the query to
run every 30 minutes you'd set the Timer Interval to 1800000 (1000 * 60
* 30). Then have an OnTimer event procedure like this:

Private Sub Form_Timer()

On Error GoTo err_

' Use DAO
CurrentDb.QueryDefs("query name").Execute dbFailOnError

exit_:
Exit Sub

err_:
MsgBox "Error: " & Err.Description

End Sub

Substitute your query name for "query name" in the QueryDefs().

The form must be open continuously for this scheme to work.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRKGQDoechKqOuFEgEQI65QCfbU2O/2AT++6R4Wh3rzo/VXF6HzEAoM/E
AgGdo9f7JwIlCE9JqkTv7sAs
=2W/4
-----END PGP SIGNATURE-----
 
Hi,

I'm trying to run the query, but without any luck.

I have created query that will append a table.

Here's the code for the form

"
Private Sub Form_Load()
TimerInterval = 600000
End Sub

Private Sub Form_Timer()
On Error GoTo err_

'Use DAO
CurrentDb.QueyDefs("Hyllypaikat ja tyypit").Execute dbFailOnError

exit_:
Exit Sub
err_:
MsgBox "Error: " & Err.Description


End Sub
"

Is this correct?

Br, Miikka

MGFoster kirjoitti:
Miikka said:
Hi,

I'm trying to create tool to save information from linked oracle db with
Access.
I have created query and would like it to run on certain intervals.

How could I do this?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use a form (hidden, if you like [Visible = False]) that uses the OnTimer
event and Timer Interval. The timer interval is in milliseconds (1000 =
1 second). Set up the OnTimer event to run the query when the Timer
Interval hits you indicated time. E.g.: Say you want to the query to
run every 30 minutes you'd set the Timer Interval to 1800000 (1000 * 60
* 30). Then have an OnTimer event procedure like this:

Private Sub Form_Timer()

On Error GoTo err_

' Use DAO
CurrentDb.QueryDefs("query name").Execute dbFailOnError

exit_:
Exit Sub

err_:
MsgBox "Error: " & Err.Description

End Sub

Substitute your query name for "query name" in the QueryDefs().

The form must be open continuously for this scheme to work.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRKGQDoechKqOuFEgEQI65QCfbU2O/2AT++6R4Wh3rzo/VXF6HzEAoM/E
AgGdo9f7JwIlCE9JqkTv7sAs
=2W/4
-----END PGP SIGNATURE-----
 
Back
Top