Ray at said:
You could still contain everything in a vbs file and then if
you want a user to be able to execute the script, use WshShell
object to execute the vbs file, if the user has permissions.
As noted originally, this precludes the possibility of giving feedback to
the user other than an ambiguous "job started" message. This is a problem
for a couple of reasons.
As you may recall the script reads the vendor's DB via the vendor's API.
What I didn't mention is that I have to use this extraction method for
several sets of data in the vendor's DB, and the API cannot read from two of
them simultaneously. In fact, if an attempt is made to read from one set
while another is being read from, both processes are killed. This is the
primary reason we mirror the data on SQL Server, since it makes simultaneous
searches in multiple data sets impossible (secondary: speed of retrieval,
which is on the order of .1 second per record returned, tertiary:
readability of web scripts due to the horrible API).
This is why I like to present feedback to the web user -- I spit out a bit
of output every 100 records, so he can see how far the job has progressed.
He can see when the job finishes and can run the next one. I suppose I can
prevent two jobs from running concurrently, but I'm certain the API doesn't
allow me to check, so I'll have to flag the start/finish events in SQL
Server**.
I have actually considered using the third suggestion here:
http://www.aspfaq.com/show.asp?id=2143, since this is a very high-traffic
application. I will have to give it some consideration.
**I already track job events for reporting purposes, so this isn't a great
burden, but I'm hesitant to use such abstracted logic, since there are
obviously situations that could arise (if the web server or SQL Server box
crashed in the middle of the job, for example) that would cause the job to
abort without an appropriate flag in the DB. Job initiation logic requiring
the completion of already started jobs would then leave me in a state that
disallows *any* jobs from running until the DB entry is cleared.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.