Compact Framework - alling aspx page from SQL server scheduled job ?

Asked By jack yao on 11-Feb-04 02:59 PM
Dear Mr. Bromberg, 

I read an article posted on EddHeadCafe about schedule a asp page from SQL server.  I tried to call an aspx (asp.net page)  from the schedule job.  Nothing happens.  The log say it was successful, but the page is not executed.  Is it different to call aspx page than asp page. 

http://www.eggheadcafe.com/articles/20010328.asp 

Thanks in advance for any help (code example will be greatly appreciated)

Calling aspx page from SQL server scheduled job? - Asked By jack yao on 11-Feb-04 03:00 PM

Dear Mr. Bromberg, 

I read an article posted on EddHeadCafe about schedule a asp page from SQL server.  I tried to call an aspx (asp.net page)  from the schedule job.  Nothing happens.  The log say it was successful, but the page is not executed.  Is it different to call aspx page than asp page. 

http://www.eggheadcafe.com/articles/20010328.asp 

Thanks in advance for any help (code example will be greatly appreciated)

Make sure that your page does not have html tags - Asked By Doug Snyder on 11-Feb-04 03:29 PM

Jack,

I had the same problem with calling an ASP page and found that you can not have any html tags in the page. I stripped out the tags to only have ASP and it worked fine. I don't know if this would solve it for an ASPX page, but it's woth a shot.

Hope this helps.

Doug

aspx page need some html tags - Asked By jack yao on 11-Feb-04 03:51 PM

can't delete all of html tags, any other options?

i removed most of the html tags, but kept these, still did not work

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="ProcessMail.aspx.vb" Inherits="EY.TAS.ConnectionCheck.Web.ProcessMail"%>
<html>
	<body MS_POSITIONING="GridLayout" onload="window.open('CloseProcessMailPage.htm?yup=1');">
		<form id="Form1" method="post" runat="server">
			<asp:Label id="LabelSuccess" runat="server">Label</asp:Label>
		</form>
	</body>
</HTML>
Have you tried running the WSH - Asked By Dexter Dotnetsky on 11-Feb-04 04:17 PM
script by itself? If it works, then you may just have to deal with a permission
problem.
If it doesn't work, then let us know.
You are making an HTTP request, the type of page (asp or aspx) should not make any difference at all. If the server gets the request correctly, it will serve the page.
Yes, I did run from dos prompt, it works! - Asked By jack yao on 11-Feb-04 04:59 PM
Dr. DotNetsky,

I also add a 2nd page there to close the IE window after it runs.  Otherwise, the browser window will stay and the rountine won't run for the next call.  It runs great under command prompt.  I don't know why the SQL agent won't be able to start the job.

I would try the other guy's idea of stripping all all the html tags in an asp page, then in that page to call my call aspx page.  But it seems silly to do that.

Thanks in advance for any other ideas. 

Jack
Tried your suggestion, did not work! - Asked By jack yao on 11-Feb-04 05:34 PM
Doug,

This is in my sheduled job (VB script)

Dim WshShell 
Set WshShell =CreateObject("WScript.Shell") 
WshShell.Run ("http://199.50.23.106/ConnectionsCheck/eMail/OpenProcessMail.asp") 
Set WsShell = Nothing

I made an asp page, stripped all of the html tag. only one line of code:
<%response.Redirect ("ProcessMail.aspx")%>
This asp page will call my aspx page.  Works if I run the vbs script from command prompt.  Scheduled job, still nothing happens.

Please help,
Jack
Dr. DotNetsky - Asked By jack yao on 12-Feb-04 02:40 PM
Any new thoughts on this?

If I can't do this, I will either have to schedule the job as a wondows task or use the timer class to do it within the web application 

Jack
I am having a similar problem - Asked By Doug Snyder on 23-Feb-04 10:51 PM
Jack,

I am having a similar problem. I had a working solution prior to updating to IE 6.0 on my web server. When using IE 5.x my SQL job would call the script that called IE, perform a POST, and would immediately close the instance of IE. I was able to view this in Windows NT task scheduler. After I upgraded to IE 6.0, I noticed in the task scheduler that IE was not closing after the POST. My jobs were executing for a while and would then stop; presumably because there were too many threads of IE. I then tried to find a way to close IE after the ASP code ran and found that there really isn't a good way. If you use the Window.Close method IE 6 wants to give a message that the window is trying to close and requires a user to accept the closing of the window. Not very helpful when trying to automate something.

Does anyone have a way to close IE 6.0 after code processing other than window.close? Or; is there a way to handle the message?

Doug