Regular automatic running of ASP program code _ Application Tips

Source: Internet
Author: User
Objective

It is often hoped that at a certain time, an individual ASP program can be used to do some work, such as: the development of letters, data library, etc.

Method

One, you can go to find Aspexe components to use

Second, you can use the WSH approach. The following article is to be uploaded to a website (I've already forgotten it)

WSH is basically the same as the ASP's notation, except
No need to add ASP separator
The file's name is. vbs
Since the Asp.dll is not used, there is no ASP's object pattern and is not suitable for
Cannot use the servo-side inclusion, so some ADO constants need to be declared by themselves

' Please don't use Server.CreateObject
Set oconn = CreateObject ("Adodb.connection")
oConn.Open yourconnstring
sSQL = "Update Adinfo set Adstatus=0" _
& "where validtodate<=" & Date & "'"
Oconn.execute (sSQL)
Oconn.close
Set oconn = Nothing
Save the file as C:scriptsupdateadstatus.vbs, WSH has two versions, one for the window (Wscript.exe), one for the command list (cscript.exe), in this case we will use (cscript.exe), you can The OS command column is executed.

C:>cscript C:scriptsupdateadstatus.vbs

Then you can check with Query Analyzer to see if the data is updated, in practical applications, it is recommended that you use this to work in different times, as if I were to create a batch file called Dailytask.bat to perform all the daily routine work, so All I need to do is to put all my daily script files into this batch, and then use the at Command or SQL Server Agent to perform daily dailytask.bat

Strong advice to use the SQL Server Agent is more efficient and stable than using the at Command! To set the SQL Server Agent you can perform Enterprise Manager, and you will see this after the exhibition.

Mouse Right click Jobs, choose New Job
Choose Step Press New
Specify step Name, Type Select the operating System command, and set the command for the Execute
Select Schedule to set your schedule

Third, use the  vbs  program, and in  WINDOWS  auto scheduling, specify from  IE  to activate your written completion of the  ASP  program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.