?
Solved

ASP Trigger for time based event

Posted on 2013-01-14
4
Medium Priority
?
398 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 53

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 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

752 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