Solved

ASP Trigger for time based event

Posted on 2013-01-14
4
372 Views
Last Modified: 2013-01-16
Hi,

Running classic ASP with Sql Server (sql version), I need to find a solution for triggering a time-based event in this stateless environment.  Surely there must be some way to do this.  Eg I need a way to trigger a function in classic ASP code that imports data from an external txt file into SQL server table.  This even needs to run at five in the morning every day.
 
If not classic ASP, then how is it done in .NET?  We could turn on .NET for that purpose alone.

Thanks for any help...
0
Comment
Question by:crystaltec
  • 2
  • 2
4 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38777023
You simply need to run a scheduled task.  Do you have access to the task scheduler or are you on a shared host?  Some shared  hosts will have a way for you to schedule a task.  You can have the task scheduler hit your asp page or just make it a vb or vbs.
0
 

Author Comment

by:crystaltec
ID: 38777062
I have full access to the host. So the scheduled task would literally open a page on my site?
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 38777072
I have task scheduler hit a vbs file that does an xmlhttppost to my asp page.  The vbs file can be outside of your website.  I will  post some data so the page knows it was the server hitting it and not something else.  




Call RunFile() 
 Sub RunFile() 

     'Force the script to finish on an error. 
     On Error Resume Next 

     Declare variables 
     Dim objRequest 
     Dim URL 

     Set objRequest = CreateObject("Microsoft.XMLHTTP") 

	 theData="x=123&y=abc&z=ee" 
     URL = "http://www.mydomain.com/file.asp" 

     objRequest.open "POST", URL , false  
	 objRequest.setRequestHeader "lastCached", now() 
	 objRequest.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 
     objRequest.Send theData
     Set objRequest = Nothing 

 End Sub 

Open in new window


Does  your name come from the old hosting company?  If so their control center panel has a task scheduler that can hit a page directly.
0
 

Author Comment

by:crystaltec
ID: 38785051
Seems to work perfectly.

Thanks!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now