Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

server.execute fails

Status
Not open for further replies.

Microbe

Programmer
Oct 16, 2000
607
AU
Hey folks,

I have a weblog application at - code is available if anywone wants it.

I recently updated the way it builds an XML file so that rather than build it everytime it was requested, it is now only built when I edit or create content.

Code:
if request.querystring("action") = "add" then
	MM_editQuery = "insert into blog (content,title,description,stickynote) values ('" & editorvalue & "','" & newtitle & "','" & newdescription & "',off)"
'on error resume next	
	edittxt = MM_editquery
   	MM_editCmd.CommandText = MM_editQuery
	MM_editCmd.Execute

[b]server.execute("buildxml.asp")[/b]

elseif request.querystring("action") = "update" then
	MM_EditQuery = "update blog set content='" & editorvalue & "', title='" & newtitle & "', description = '" & newdescription &  "', stickynote = " & stickynote & " where ID = " & request.form("ID")
   	MM_editCmd.CommandText = MM_editQuery
	MM_editCmd.Execute
	
[b]server.execute("buildxml.asp")[/b]
	
end if

Note that after both the insert and update are executed I call buildxml.asp to recreate the XML file. Well, that's the plan, but it fails on the insert without returning an error.

I have changed the code to execute a non existing page and it breaks so I know I am hitting the spot.

The only thing I can think of is that the db isn't updated by the time I call buildxml.asp. Is this likely the problem? If so, short of looping for 1/2 a second as a time waster, is there another solution.

What else might be causing this?

Thanks in advance.

Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
I ran into that problem once and had my hosting service set the permissions to the db directory so that the script could write to the db as well as read from it.

Once they set the permissions correctly, the error disappeared.

Just a thought

Steven E. ncw
 
Thanks for that Steve, but that isn't the problem.

It does work if I edit content or run the buildXML.asp page directly.

The problem is just that it doesn't execute the page automatically when called after I insert new content despite the code being identical to the update code.

Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
What version of IIS is being used? If it is version 4 (on NT 4) then Server.Execute and Server.Transfer will not work as they are not supported until IIS v5+ (on Windows 2000 and higher)

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Good thought, but it DOES work, just not when I insert a record.

That's what has me scratching my head. It works after executing the UPDATE, but not after executing the INSERT - the code is identcal

Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top