ASP timeout.... or vb app?

T

twindscheffel

I have an asp page that runs as a Scheduled Task on an un-manned PC
(Win XP Pro). It loops through a list of recipients, runs a SQL query
for each one, formats the results (if any) as HTML and writes the html
back in to the database at the same time as sending the email.

At the moment, we are only testing it and it sends about 10 emails at
once, taking perhaps a second or two which is fine. When I make it
available to other users, there could be as many as 1000 emails to
send (and there could be 2 sql queries to run for each email) so I am
concerned that that asp page may time out.

Would it be better to use an asp timeout command to increase the time
permitted to run, or would it be better to turn in to a vbs file or
even make it a vb application?

Incidentally, I have tried to write vb applications using VB Studio
Express 2008 but can't find a way to create a connection to my
external SQL database. I know this is probably not the best place to
start but can anyone give a definite yes/no answer to whether it is
possible to connect to external SQL databases in VB Studio express?
(and if yes, any sample code anywhere?)

Thanks
 
D

Daniel Crichton

(e-mail address removed) wrote on Thu, 18 Dec 2008 07:01:58 -0800
(PST):
I have an asp page that runs as a Scheduled Task on an un-manned PC
(Win XP Pro). It loops through a list of recipients, runs a SQL query
for each one, formats the results (if any) as HTML and writes the html
back in to the database at the same time as sending the email.
At the moment, we are only testing it and it sends about 10 emails at
once, taking perhaps a second or two which is fine. When I make it
available to other users, there could be as many as 1000 emails to send
(and there could be 2 sql queries to run for each email) so I am
concerned that that asp page may time out.
Would it be better to use an asp timeout command to increase the time
permitted to run, or would it be better to turn in to a vbs file or
even make it a vb application?

Personally I'd make it a VBS file if the task is run on the same machine
that has IIS and the ASP page on, that way you're not relying on the ASP
engine and IIS, or invoking via a call to a web browser, so there are fewer
potential problems as there will be fewer applications in the chain.
 
T

Tom

Huh? Why are you using an asp page for a task that a simple vbscript
file could do? Seehttp://www.aspfaq.com/show.asp?id=2143

Sorry, should have elaborated a little bit. Currently the scheduled
tasks calls a URL in IE - so the asp page is hosted on a web server
with the SQL server. I am all self taught starting with asp so dont
have any background in vb other than what i know from asp.

The only problem i see with my current setup is that the template html
for the email is stored as an html file on the webserver -could a vb
script read the text from that file using even though it is on a
different server? I suppose I could store the html in the database.

IIS is installed on the PC the scheduled task runs on, so i guess
CDONTS should work for sending the emails?

Thanks for your help
Tom
 
B

Bob Barrows

Tom said:
Sorry, should have elaborated a little bit. Currently the scheduled
tasks calls a URL in IE - so the asp page is hosted on a web server
with the SQL server.

On a different box?
I am all self taught starting with asp so dont
have any background in vb other than what i know from asp.

You must not have read my link: no vb required: only the vbscript you
used in your asp page.

The only problem i see with my current setup is that the template html
for the email is stored as an html file on the webserver -could a vb
script read the text from that file using even though it is on a
different server? I suppose I could store the html in the database.

IIS is installed on the PC the scheduled task runs on, so i guess
CDONTS should work for sending the emails?

It depends. It may already be installed. It is very likely that you want
to be using CDO, not CDONTS:
http://classicasp.aspfaq.com/email/how-do-i-send-e-mail-with-cdo.html
 
T

Tom

On a different box?

Yes - scheduled task on PC at home, SQL hosted on a remote server, and
website hosted on a separate webserver elsewhere. The asp page and the
html file are both on the webserver.
You must not have read my link: no vb required: only the vbscript you
used in your asp page.

I did read the link - thanks, was very helpful - was just answering
your first question of why I used an asp page in first place and not
vb!! Looks like I just need to change the server.createobject and
remove the response.write references I have that are used for
debugging.
It depends. It may already be installed. It is very likely that you want
to be using CDO, not CDONTS:http://classicasp.aspfaq.com/email/how-do-i-send-e-mail-with-cdo.html

You're right, i'm using CDO currently on the webserver so shouldnt be
an issue. Have just checked on the local machine and CDO is installed
so i'll give it a whirl. Thanks very much!!
 
B

Bob Barrows

Tom said:
You're right, i'm using CDO currently on the webserver so shouldnt be
an issue. Have just checked on the local machine and CDO is installed
so i'll give it a whirl. Thanks very much!!

If you can access the sql server from your local machine, then you won't
even need to bother the web server box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top