Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 20th, 2003, 10:55 AM
Authorized User
 
Join Date: Jul 2003
Location: Franklin, Indiana, USA.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default Autofire database query

I have created a query that needs to run once a day to send reminder notices to everyone that is scheduled to work a service in 5 days. All of the code in the page works when I fire the page, but I need the page to fire once on its own at some specific time (i.e. 00:00:01). How do I get the server to fire the page without user intervention?

Rich Hoffmann

__________________
Ego is a faithful friend; He stays with us all the way to the crater.
  #2 (permalink)  
Old August 20th, 2003, 11:57 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Rich,

What kind of database are you using? For example, SQL Server supports scheduling of Stored Procedures.

If you're using another kind of database, let me know. There are other ways to schedule stuff like this too.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old August 20th, 2003, 12:30 PM
Authorized User
 
Join Date: Jul 2003
Location: Franklin, Indiana, USA.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Access 2000, Front Page 2002, I am using JavaScrip ASP code to create the SQL command and generate emails to each person that is returned by the query.

  #4 (permalink)  
Old August 20th, 2003, 12:49 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Rich,

Well, in that case you may want to take a look at .vbs or .jse files

These files are more or less the same as ASP pages (they use the same scripting language, like VBScript or JavaScript) but they run at the desktop, and not through a server.

You can use more or less the same code and objects (Recordsets, Connections, etc.) except for ASP intrinsic stuff, like Response and browser related stuff, like alert(Use WScript.Echo instead).

The good thing about a .vbs file is that it's very easy to schedule its execution through the Windows Scheduled Task feature.

All you need to do to get going is create a text file, rename it with a .vbs extension and open it in Notepad. You don't need <% and %> delimiters, you can place the VBScript or JScript right inside the file. Theoretically, you could get away with copying and pasting ASP code.

Useful links:

http://msdn.microsoft.com/library/de...ng11132000.asp
http://msdn.microsoft.com/library/de...ting061499.asp

Let me know if you need more advice....

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #5 (permalink)  
Old August 20th, 2003, 01:31 PM
Authorized User
 
Join Date: Jul 2003
Location: Franklin, Indiana, USA.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I really need this function to operate on the server. Is this not possible?

  #6 (permalink)  
Old August 20th, 2003, 02:48 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Well, it *can* operate on the server, as you can save and schedule the file there.

The alternative is to schedule Internet Explorer to pop open at certain times and request the page. Pretty messy solution.

By creating a script file, you can stick to the same programming knowledge you use for your ASP pages. IMO, it's a nice and clean way to run stuff at the server at certain intervals.

I have been using scripts like this for years to both read and send e-mail from automated accounts and it works perfect.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #7 (permalink)  
Old September 3rd, 2003, 03:00 PM
Authorized User
 
Join Date: Jul 2003
Location: Franklin, Indiana, USA.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry for the long delay in this response. Been on other things lately.

I have read the 2 articles that you sent me and they both flew right over my head. Can you send me an example of code you have written that resides on the host and fires a single .asp file once a day?

I really appreciate the help!

Rich

  #8 (permalink)  
Old September 5th, 2003, 01:28 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Rich,

Late response here as well as I was quite busy.

If you insist on executing an ASP page in your browser, create a small .vbs file that uses the Wscript.Run method to fire up your browser and pass it the URL you want to open. However, I recommend not using this method. It's pretty difficult getting rid of open browser Windows. If you return to your server, you may have loads of open Explorer Windows.

IMO, the preferred way to do this is to copy your ASP code to a .vbs file, remove / modify any code relating to Response / Request etc. objects and the script should run fine.

Take a look at this article for a simple example of a .vbs file. If you look at the second method, you'll find the code to be exactly the same as in an ASP page.

Search Google for Schedule ASP page and you'll find loads of other useful examples.

There also seems to be a commercial application that can handle this. It's available at http://www.script-schedule.com/. I have never tried it, so I don't know if it will do what they say it does.

HtH,

Imar



---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


Similar Threads
Thread Thread Starter Forum Replies Last Post
database query problem naveed77 Beginning VB 6 2 February 12th, 2008 06:47 AM
Query from Solarwinds Database Help. keevo24 SQL Server 2005 1 July 27th, 2007 03:57 PM
Problem with my database query jmurrayhead Classic ASP Databases 2 March 12th, 2004 03:48 AM
Multiple Database query nlicata SQL Language 1 August 15th, 2003 03:34 AM
database query Darren JSP Basics 0 July 12th, 2003 03:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.