CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 1999
    Location
    USA
    Posts
    101

    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


  2. #2
    Join Date
    Sep 1999
    Location
    Germany
    Posts
    66

    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

  3. #3
    Join Date
    Jul 1999
    Location
    USA
    Posts
    101

    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.


  4. #4
    Join Date
    Oct 1999
    Location
    CA
    Posts
    91

    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

  5. #5
    Join Date
    Jul 1999
    Location
    USA
    Posts
    101

    Re: how to Automate an Access database

    How to use autoexec macro? Is it possible in Access? Please lemme know

    Thnaks


  6. #6
    Join Date
    Oct 1999
    Location
    CA
    Posts
    91

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured