Click to See Complete Forum and Search --> : how to Automate an Access database


sriky
October 26th, 1999, 08:12 AM
I need to automate an Access database. I have data in 1 hour interval. This data should be stored for 3 days. After that, the data should be automatically updated to daily intervals. Can I do that using an Access module or in VB code.

Any ideas,

please

smalig
October 26th, 1999, 10:28 AM
Test follow code for use MS Access database in VB code:

Dim dbTest As Database
Dim sPassword as String

' Your password value
sPassword = your_password

Set dbTest = wrkJet.OpenDatabase("d:\test.mdb", True)
Set rst1 = dbTest.OpenRecordset(Table1)

With rst1
.AddNew
!Field1 = Value
.Update
End with

rst1.Close
dbTest.Close

smalig@hotmail.com
http://smalig.tripod.com

sriky
October 26th, 1999, 10:51 AM
your code might work well within vb, only when the client is using the system. But I want to update the database automatically, even when there is no user. Is there something I can code in Access itself?

Thanks for the response.

BrewGuru99
October 26th, 1999, 01:50 PM
Of course, you'll have to have the database open, or the external vb program open inorder to allow it to keep track of the time. Or you can set up some scheduled tasks to open up the database, and have an autoexec macro trigger what is needed.

I'm sure you could use the timer on a form to keep track of the time.

Brewguru99

sriky
October 27th, 1999, 12:40 PM
How to use autoexec macro? Is it possible in Access? Please lemme know

Thnaks

BrewGuru99
October 27th, 1999, 03:02 PM
For an autoexec macro, simply name the macro "Autoexec" and it'll run when the database is frist opened. I suppose you could use that to open a form that utilizes it's own timer to automate the actions you need.



Brewguru99