Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP Trigger for time based event

Posted on 2013-01-14
4
Medium Priority
?
410 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 54

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 54

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

604 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