Solved

ASP Trigger for time based event

Posted on 2013-01-14
4
393 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 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

726 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