msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Executing page

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB General Discussions
Author Message
Paulo



Joined: 04 Oct 2007
Posts: 24

PostPosted: Tue Feb 26, 2008 4:52 pm    Post subject: Executing page Reply with quote

I need to execute some aspx page on the server everyday at 10PM.

Should I do a VB6 exe with browser component wich opens the url and after
executing closes itself?

The server should be scheduled to run this program every day... What do you
think ?

Archived from group: microsoft>public>vb>general>discussion
Back to top
View user's profile Send private message
Paulo



Joined: 04 Oct 2007
Posts: 24

PostPosted: Tue Feb 26, 2008 4:59 pm    Post subject: Re: Executing page Reply with quote

but how can I know if the page was executed succesfully? and after closing
the program...

"Paulo" escreveu na mensagem @TK2MSFTNGP05.phx.gbl...
>I need to execute some aspx page on the server everyday at 10PM.
>
> Should I do a VB6 exe with browser component wich opens the url and after
> executing closes itself?
>
> The server should be scheduled to run this program every day... What do
> you think ?
>
>
Back to top
View user's profile Send private message
Stefan Berglund



Joined: 04 Oct 2007
Posts: 636

PostPosted: Tue Feb 26, 2008 2:51 pm    Post subject: Re: Executing page Reply with quote

On Tue, 26 Feb 2008 11:59:07 -0300, "Paulo" wrote:
in

>but how can I know if the page was executed succesfully? and after closing
>the program...
>
>"Paulo" escreveu na mensagem
>@TK2MSFTNGP05.phx.gbl...
>>I need to execute some aspx page on the server everyday at 10PM.
>>
>> Should I do a VB6 exe with browser component wich opens the url and after
>> executing closes itself?

There are several ways you could do this. One way would be to use a
recordset object to open the page and have the page return the status in
the response object.

---
Stefan Berglund
Back to top
View user's profile Send private message
Paulo



Joined: 04 Oct 2007
Posts: 24

PostPosted: Tue Feb 26, 2008 9:33 pm    Post subject: Re: Executing page Reply with quote

So, show me how! Please!

"Stefan Berglund" escreveu na mensagem @4ax.com...
> On Tue, 26 Feb 2008 11:59:07 -0300, "Paulo" wrote:
> in
>
>>but how can I know if the page was executed succesfully? and after closing
>>the program...
>>
>>"Paulo" escreveu na mensagem
>>@TK2MSFTNGP05.phx.gbl...
>>>I need to execute some aspx page on the server everyday at 10PM.
>>>
>>> Should I do a VB6 exe with browser component wich opens the url and
>>> after
>>> executing closes itself?
>
> There are several ways you could do this. One way would be to use a
> recordset object to open the page and have the page return the status in
> the response object.
>
> ---
> Stefan Berglund
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1081

PostPosted: Tue Feb 26, 2008 4:45 pm    Post subject: Re: Executing page Reply with quote

"Paulo" wrote in message @TK2MSFTNGP05.phx.gbl...
>I need to execute some aspx page on the server everyday at 10PM.
>
> Should I do a VB6 exe with browser component wich opens the url and after
> executing closes itself?
>
> The server should be scheduled to run this program every day... What do
> you think ?

My first thought would be to take the code that needs to be executed and put
it into some component that can be called from the web page as well as from
a scheduled task. It seems awkward to run something to connect to the web
server to run the code when you could just run the code....
Back to top
View user's profile Send private message
Stefan Berglund



Joined: 04 Oct 2007
Posts: 636

PostPosted: Tue Feb 26, 2008 6:09 pm    Post subject: Re: Executing page Reply with quote

On Tue, 26 Feb 2008 11:52:21 -0300, "Paulo" wrote:
in

>I need to execute some aspx page on the server everyday at 10PM.
>
>Should I do a VB6 exe with browser component wich opens the url and after
>executing closes itself?
>
>The server should be scheduled to run this program every day... What do you
>think ?
>

As Bob pointed out this may not be the ideal way to what you're doing
but since you didn't tell us what it is you want to do...

In this example the VB app could run on any desktop and you would
schedule it to run everyday at 10PM. The ASP will perform whatever
function you wish and then return the status.

The VB app would look like this:

Private Sub Command1_Click()

On Error Resume Next
Dim rs As ADODB.Recordset: Set rs = New ADODB.Recordset
rs.Open "http://stefs-server2/blahblahblah/test1.asp"
If (Err.Number 0) Then
Debug.Print Err.Description
Err.Clear
Else
Debug.Print "datum="; rs.Fields("Some_Name").Value
End If

End Sub


The ASP should contain no HTML and should not output anything to the
Response object other than the contents of the recordset with whatever
values you want. The example shows a VarChar field of length 64.

<%Option Explicit
Dim rs: Set rs = CreateObject("ADODB.Recordset")
With rs
.Fields.Append "Some_Name", 200, 64
.Open
.AddNew
.Fields("Some_Name").Value = "woo hoo - we're cookin with gas!"
.Save Response
.Close
End With%>

---
Stefan Berglund

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB General Discussions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group