how to Automate an Access database
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
Re: how to Automate an Access database
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
[email protected]
http://smalig.tripod.com
Re: how to Automate an Access database
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.
Re: how to Automate an Access database
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
Re: how to Automate an Access database
How to use autoexec macro? Is it possible in Access? Please lemme know
Thnaks
Re: how to Automate an Access database
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