shelling an app on server from asp?

R

Rich

Hello,

I would like to turn on/invoke a VB6 app which resides on
the server/folder where IIS is running from an ASP page.
As for security, this would be all happening within an
intranet with firewall protection, etc, no outside
internet access. In pseudocode of my asp app I am
thinking like this:

<%
....
RetVal = Shell("../myApp.exe " & someArg, vbNormalFocus)
....
%>

I would like to be able to invoke myApp from anywhere
within my company. Is it doable what I would like to do?
And if so, if my pseudo code above is not going to work,
may I request if someone could share the correct method?

Thanks,
Rich
 
R

Rich

Well, I went and tried the code sample from the webpage
below. This code did invoke myApp from the ASP as I could
see it in the Windows Task Manager as running, but myApp
was not visible when invoked from the ASP. I tried the
same code from a .vbs file, and myApp was visible. Is
there a way to make myApp visible when invoking from the
ASP?

Thanks,
Rich
 
T

Tom Kaminski [MVP]

Rich said:
Well, I went and tried the code sample from the webpage
below. This code did invoke myApp from the ASP as I could
see it in the Windows Task Manager as running, but myApp
was not visible when invoked from the ASP. I tried the
same code from a .vbs file, and myApp was visible. Is
there a way to make myApp visible when invoking from the
ASP?

That's because when launched from ASP, the app is running under the
context/desktop of the web server. Is it really practical to run that kind
of app from a web server? What are you trying to do?
 
R

Rich

I have to pull data into a Sql Server on this server 2 or
3 times a week (1,000,000+ records) from another
datasource within my company. I have been requested to
automate this process. I was thinking about having a
webpage someone could bring up within the company intranet
and send parameters to my app which would invoke the data
pulling apps.

Another trick I was thinking about was to just pass data
to the app's let properties. In MS access I can make a
reference to the App and then say Set x = New myApp,
x.letParm1 = #9/1/03#. I can also instantiate myApp with
CreateObject("myAppProj.class1") from vbs (or Access).
But I like to have the app just running and use GetObject,
and then pass data to it. I was not able to use GetObject
(, "myAppProj.class1") in my test vbs file. Is there a
way I could write directly to myApp while it is running
from asp/vbs? I can do that from ms Access, how to do it
from script?

I realize that there are several ways I could pass data to
the server, and just have myApp polling for messages or
textfiles, and I could even send an argument with
parameters with wsShell.run "myApp.exe " & #9/1/03#, and
it does not have to be visible. But I would rather have
myApp running visibly and be able to pass/write data to it
which would show up like in a textbox. How can I
reference myApp from asp/vbs like in ms Access or use
GetObject so that I could write/pass data directly to the
running instance of myApp?

Thanks,
Rich
 
B

Bob Barrows

Rich said:
I have to pull data into a Sql Server on this server 2 or
3 times a week (1,000,000+ records) from another
datasource within my company. I have been requested to
automate this process. I was thinking about having a
webpage someone could bring up within the company intranet
and send parameters to my app which would invoke the data
pulling apps.
Why not use the builtin SQL Server capabilities? You can use SQL Agent to
schedule a DTS package to run periodically.

Bob Barrows
 
R

Rich

(you asked for it :) I have to pull data from a Lotus
Notes Domino Server (actually 4 of them). The datasets I
am pulling contain like 200 fields a piece and like
300,000+ records apiece. The fields can contain any
manner of data, and more times than not people have
entered characters that are not ascii based or recognized,
etc. So I have a VB app which pulls this data and cleans
up unacceptable characters, and writes nice clean ascii
text to my sql server tables and in sql I have sp's that
converts dates back to date format, etc. Maybe DTS could
do all this too, and I'm sure I should purchase a book on
DTS, but I haven't. Truth is, I just don't see how DTS
could pull data from a Lotus Notes DB since Notes is
document based (as opposed to relational). I was hoping I
could pass parameters to my pulling app (day and time to
pull data) and also read back timestamp data from when
data was pulled back to the asp. I have noticed that I
can invoke my app from asp, but I can't seem to write data
to the disk from my app when called by asp (I'm sure that
is a feature of asp - maybe not?) I am looking to use set
x = GetObject("c:\somedir\myApp.exe"), x.letParam=...

and soforth. The alternative would be to load an app on
each workstation that needs to deal with this project. I
just thought that planting a hyperlink on the desktop
would have been a lot easier with just one app on the
server. Any comments appreciated (can I use GetObject in
asp?).

Thank you again for your reply.
Rich
 
R

Rich

OK. Someone at my place just gave me a great idea (so
simple!). Write my paramters to an Access mdb with ADO.
Let Access manipulate my pulling programs. I would never
have thought of this because this is just too easy :).
This guy also mentioned that I need to step up to .Net
(which is already at my disposal).

I thank everyone for your responses to my posts.
Rich
 
B

Bob Barrows

Rich said:
(you asked for it :) I have to pull data from a Lotus
Notes Domino Server (actually 4 of them). The datasets I
am pulling contain like 200 fields a piece and like
300,000+ records apiece. The fields can contain any
manner of data, and more times than not people have
entered characters that are not ascii based or recognized,
etc. So I have a VB app which pulls this data and cleans
up unacceptable characters, and writes nice clean ascii
text to my sql server tables and in sql I have sp's that
converts dates back to date format, etc. Maybe DTS could
do all this too, and I'm sure I should purchase a book on
DTS, but I haven't. Truth is, I just don't see how DTS
could pull data from a Lotus Notes DB since Notes is
document based (as opposed to relational).

Given the proper ODBC driver oo OLEDB Provider, DTS can certainly do this.

Bob Barrows
 
B

Bob Barrows

Rich said:
Surely there is a way to do this with ASP, ...

I don't know. I am very much opposed to doing time-consuming tasks (such as
data exports/imports) via ASP, so muxh so that I've never really
investigated ways of doing them. This is not something I would recommend
doing in a client-server environment.


You could create a VB application, and use SQL Agent to run it periodically,
passing parameters to it via the command line ...

Bob Barrows
 
R

Rich

Thank you for this idea. Oh, and I didn't mean to do data
import/export via ASP. I meant pass params via ASP. But
the command line idea sounds interesting. Unfortunately
for me, I came into the programming scene after gui had
taken over and am not well versed with command line
stuff. Is it possible to send params from another
workstation to the server via the command line? What
would it look like?

C:\cd \\server1\f:\dir1 or C:\\cd U:\dir1
U:\dir1\myApp.exe arg1, arg2

Even though my app lives on the server, by calling it from
a workstation, wouldn't that invoke the app on the calling
workstation? So data would go from Domino server to
workstation to the server where Sql Server resides.
Hopefully, I will figure out the best way to do what I am
doing with the least amount of installing apps on
workstations, or having apps on the server which poll
24/7. I just thought ASP might be an option. Command
Line, hmmm, interesting.

Rich
 

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,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top