dcsimg
Results 1 to 4 of 4

Thread: Server.CreateObject Failed

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Server.CreateObject Failed

    Hi, i am trying to make a comments page for a website but when i upload it to a free hosting account and try to test the page i keep getting

    Server.CreateObject Failed

    is this problem because the servers don't support the command or because i have coded it wrong

    here is my code:

    Code:
    <%
    	if Request.QueryString.Count = 0 then
    		errStr = "<font color='blue'>Please enter a comment or feedback.</font><br>"
    	else
    		if Request.QueryString("ErrorType") = "1" then
    			smallerrstr = "Error: Your message has been included."
    			errStr = "<font size='+1' color='red'>" & smallerrstr & "</font><br>"
    		else
    			errStr = "<font color='blue'>Please enter a comment or feedback.</font><br>"
    	   	end if
    	end if
    
    if (lcase(Request.Form("submitted")) = "true" )Then
    	if (IsNull(Session("feedbacked"))) then
    		Session("feedbacked") = False
    	end if
    	if (Session("feedbacked")=True) then
    		errStr = "<font size='+1' color='red'>You are allowed only one message per session.</font><br>"
    	else
    		Session("feedbacked")=True
    		smessage = Request.Form("feedbody")
    		smessage = Trim(smessage)
    		smessage = Replace(smessage,"<","")
    		smessage = Replace(smessage,">","")
    		sname = Request.Form("feedname")
    		sname = Trim(sname)
    		sname = Replace(sname,"<","")
    		sname = Replace(sname,">","")
    		smail = Request.Form("feedmail")
    		smail = Trim(smail)
    		smail = Replace(smail,"<","")
    		smail = Replace(smail,">","")
    		sdate = Now()
    		smessage = smessage & "<br><b><font color=blue>- " & sname &  " - " & smail & " (" & sdate & ")</font></b>"
    
    		sfile = "_feedback.txt"
    		whichFN=server.mappath(sfile)
    		if (whichfN <> "") and (Not ISNull(whichFN)) then
    			Set fstemp = server.CreateObject("Scripting.FileSystemObject")
    			if (fstemp.FileExists(whichFN) = True) then
    				Set filetemp = fstemp.OpenTextFile(whichfN, 8, false, 0)
    				filetemp.writeLine("<FEEDBACK>")
    				filetemp.WriteLine(smessage)
    				filetemp.writeLine("</FEEDBACK>")
    				filetemp.Close
    				set filetemp=Nothing
    			end if
    			set fstemp=Nothing
    		end if
    	end if
    end if
    
    
    	sfeedback = "<font name=Verdana size=2>"
    	sfile = "_feedback.txt"
    	whichFN=server.mappath(sfile)
    	if (whichfN <> "") and (Not ISNull(whichFN)) then
    		Set fstemp1 = server.CreateObject("Scripting.FileSystemObject")
    		if (fstemp1.FileExists(whichFN) = True) then
    			Set filetemp = fstemp1.OpenTextFile(whichfN, 1, false, 0)
    			Do while (filetemp.AtEndofStream <> True)
    				strLine = filetemp.ReadLine
    				strLine = Replace(strLine,"<FEEDBACK>","")
    				strLine = Replace(strLine,"</FEEDBACK>","<hr>")
    				sfeedback = sfeedback & strLine
    			Loop
    			filetemp.Close
    			Set filetemp = Nothing
    		else
    			Set filetemp = fstemp1.CreateTextFile(whichfN, false)
    			filetemp.close
    		end if
    		Set fstemp1 = Nothing
    	end if
    	sfeedback = sfeedback & "</font>"
    
    
    %>
    all help appreciated
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  2. #2
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,132

    Re: Server.CreateObject Failed

    Is if failing creating the object or when you are trying to access the file? Try creating a simple asp page that just does
    Code:
    fstemp1 = server.CreateObject("Scripting.FileSystemObject")
    Set fstemp1 = Nothing
    If you don't get an error there then it is a permissions issue when you try to access the file.

  3. #3
    Addicted Member
    Join Date
    Oct 2006
    Location
    Chennai, India
    Posts
    198

    Re: Server.CreateObject Failed

    Try checking the necessary premission to create the runtime objects with that account....
    Regards
    Srinivasan Baskaran
    India

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Re: Server.CreateObject Failed

    thanks for the replys and i found out that i dont have the permissions to do it on the free hosting site that i was testing, but the hosting site im going use it on does accept it so its all fine, thanks for the help! much appreciated
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width