Server.CreateObject failed

Results 1 to 3 of 3

Thread: Server.CreateObject failed

  1. #1
    John Henckle Guest

    Default Server.CreateObject failed

    I have the following script, which is processing a string containing an HTML page:<BR><BR>.<BR>.<BR>.<BR>if title="" then<BR> response.write "no title"<BR>else<BR> strHTML = runtitle(strHTML, title)<BR>end if<BR>strHTML=replacetag(strHTML, "$BODYTEXT")<BR><BR>response.write strHTML <BR>.<BR>.<BR>.<BR>function replacetag(page, tag)<BR> dim re2<BR> Set re2 = new RegExp <BR> re2.IgnoreCase = true<BR> re2.Global = false <BR><BR>&#039; pattern="(&#060;!--)+( )*{\"&tag&"}(.*?)(End editable region)+ *--&#062;"<BR> re2.pattern="(!--"&tag&"--&#062;"<BR> match="blip blip blip"<BR> result=re2.replace(page, match)<BR> replacetag=result<BR> set re = nothing<BR>end function<BR>function runtitle(page, title)<BR> dim re<BR> Set re = new RegExp <BR> re.IgnoreCase = true<BR> re.Global = false <BR> re.pattern = "&#060;title&#062;(.*?)&#060;/title&#062;"<BR> strReplace= "&#060;title&#062;"&title&"&#060;/title&#062;"<BR> result=re.replace(page, strReplace)<BR> runtitle=result<BR> set re = nothing<BR>end function<BR><BR>Sorry the code&#039;s kind of messy. Anyway, it works fine for the first Regular expression, but when I try to call the second, it gives me this error:<BR><BR>Server object error &#039;ASP 0177 : 800a139c&#039; <BR><BR>Server.CreateObject Failed <BR><BR>/galen/template_test/index.asp, line 49 <BR><BR>The operation completed successfully. <BR><BR>Line 49 is the following line, located in function replacetag:<BR> result=re2.replace(page, match)<BR><BR>I&#039;ve switched the order of the regular expressions, and no matter what, the second one fails. I initially ran into this problem on PWS, so I tried it on IIS 4 with the same result. Does anyone have any suggestions? I&#039;m at a loss.

  2. #2
    Rohan Parkes Guest

    Default RE: Server.CreateObject failed

    You either need to escape the "(" in the pattern, or complete it with a closing bracket, depending on what you are trying to match.<BR><BR>However, I didn&#039;t get the error message you are reporting.

  3. #3
    John Henckle Guest

    Default RE: Server.CreateObject failed

    It seems to be something with the filesystem object, because when i fixed the "(", it still blew up. When I took out the file object, it worked fine. Unfortunately, the whole point of it is to read in an html file and search for comments. It seems everything I try to do in this language gets held up by stupid bugs like this. &#060;sigh&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts