Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ASP 3.0 : How to execute asp file from stored procedure Signup · Login
Author Thread
How to execute asp file from stored procedure
Posted in tutorial: Beginning E-Commerce : Object Oriented Programming
·  thegreat
User
Joined: 19 Oct 2002
Total Posts: 2
How to execute asp file from stored procedure
Posted: 19 Oct 2002
Hi,

sub : How to execute asp file from stored procedure

Please give some ways to the above query

1) how to execute an asp page automatically daily

2) execute through stored procedure

requirement is

suppose I want to send the reminder notice to all the customers whose payment has not been received fro more than 15 days. Functionality is working fine if we browse that page . But I want this job to be done automatically

thnakx

The great

hi
·  Faisal Khan
AdminAdminAdminAdmin
Joined: 24 Sep 2002
Total Posts: 547
Create a VBScript .vbs file and use task scheduling
Posted: 19 Oct 2002
There is no way that you can call, access or execute an ASP page from within a stored procedure. ASP pages can access stored procedures but stored procedures cannot access ASP pages.

To do this automatically you can create a .vbs ( VBScript ) file, which works much the same way as ASP does ( except that it cannot access Request, Response, Server, Application etc objects ). And in that page you can put the functionality you require like pulling records of customers whose payments have not been received for more than 15 days and sending them reminder emails.

Now how to call this .vbs page and how to call it regulary? You can execute it from the command prompt manually or you can create a scheduled job ( Start -> Settings -> Control Panel -> Scheduled Tasks -> Add Scheduled Task ) and make it call your .vbs page daily, weekly, monthly or whenever you want.

Faisal Khan.
Stardeveloper.com
·  thegreat
User
Joined: 19 Oct 2002
Total Posts: 2
Create a VBScript .vbs file and use task scheduling
Posted: 24 Oct 2002
Hi Faisal,

Thank you for ur reply to my mail.

But how can I include a file and create object as you said sending mails to in scheduling. I need to create a instance of the mail class , then how can I do that one.
Please guide me.

Or some other methods that we can do this job

thanks

thegreat

hi
·  Faisal Khan
AdminAdminAdminAdmin
Joined: 24 Sep 2002
Total Posts: 547
Re: Create a VBScript .vbs file and use task scheduling
Posted: 12 Nov 2002

Dim cdo
Set cdo = CreateObject("CDONTS.NewMail")

cdo.Send "Sender's Name <sender@yoursite.com>", "to@company.com", _
"Put Subject Here", "Here goes the body"

Set cdo = Nothing

You can change sender's email, receiver's email, subject and message body according to your own liking.

Create a new "SendMail.vbs" text file and copy/paste above code in it. Then after making sure SMTP Service is running which you can start by using following command:


net start smtpsvc

Open command prompt ( or double-click SendMail.vbs ) and type "SendMail.vbs" after reaching the folder it is located at. After some time check your email and you should have an email in your inbox.

Faisal Khan.
Stardeveloper.com

Users Who Have Visited This Thread In Last 24 Hours
6 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.