Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Location
    South East UK. 35 miles east of London, in sight of the River Thames.
    Posts
    297
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Automate asp script

    Hi all,

    I have a simple script that I call manually to read an access database and report back a few totals.

    What would be useful would be to have the script run automatically at 11.59pm every day and append each days totals to a text file which I can download manually into a spreadsheet when I need to.

    I have read through some of the automation tutorials but these are still a bit beyond me to modify to suit eventhough I can now follow the logic.

    Any ideas?

    Cheers

    Gary

  • #2
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The easiest thing I can think of is making a batch file that executes the script and pipes the output onto the text file, and using the Windows scheduler to run it.

    shmoove

  • #3
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    i do this alot at work to run reports,
    best thing to do is convert your code to .vbs,
    **** can be run right from your desktop, and can be scheduled with Windows Scheduled Tasks ( in control panel ) to run whenever you want..

    if you need any help converting the code just post it here,
    also you will need to create a system dsn to connect to the sql server or access data base, since dsn-less only works through iis..


    hope this helps.
    -ken

  • #4
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    Well, if you need your code to run to keep reports at an EXACT time everyday, then you will need some sort of timer program to either open up explorer and go to a specific address, run a batch file, or a vbs file.

    But if you don't need to be completly accurate with your time, you can have users run the script for you.

    Example of this would be to keep a database table with date & time, and a boolean for when the script was executed.

    So everytime a user shows up, and time = 11:59PM to 12:30AM you check the database to see if the script has been ran. If boolean = false then you run the script, or else, you don't run the script.
    Now the user doesn't even have to know they are running the script at all, you just do it while the page is loading, and once it's done, it's done!

    Make sence?

    I don't know if this is the best method for you, but you can think about it.
    Enjoy!

  • #5
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Easy thing to do

    Download a program that schedules tasks.

    Have it open up your browser
    Have the homepage set to the webpage
    The report is run.

    Something like this might help: http://www.softpedia.com/public/cat/...13-11-86.shtml

    Have not tried to program, came up on google...
    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #6
    Regular Coder
    Join Date
    Sep 2002
    Location
    South East UK. 35 miles east of London, in sight of the River Thames.
    Posts
    297
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Hi Everyone,

    Thanks for all the replies and apoligies for omitting one small, but vital, fact. The database is on my web server, not my local PC. So I need to place the automated task on the server and just ftp down the resulting text file as and when I need it.

    My own PC I close down each night so I can't have the task running from there.

    Sorry for the confusion.

    Regards

    Gary

  • #7
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    On the server that you have the web server, can you have an exe run?

  • #8
    Regular Coder
    Join Date
    Sep 2002
    Location
    South East UK. 35 miles east of London, in sight of the River Thames.
    Posts
    297
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Hi Morgoth,

    Yes, I can.

    Gary

  • #9
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    So you can easily find and download a program to run this report generator, make one, or have someone make one for you.
    And running the exe should be no problem, as long as you can run the exe on the web server computer.


  •  

    Posting Permissions

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