Thread: ASP Help

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Posts
    7
    Rep Power
    0
    I'm trying to write a simple guestbook in ASP (Please don't tell me that I should switch to another language, as I can't.). The following code is what I have so far.

    '### Write the results to file
    Dim objFSO
    Dim objFile
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(strFile, 8, True)
    objFile.Write (LineAttribute)
    objFile.Write (TextAttribute)
    objFile.Write Server.HTMLEncode(Request.Form("comment"))
    objFile.Write "</p><p align='right'>"
    objFile.Write Server.HTMLEncode(Request.Form("name"))
    objFile.Write ", <a href='mailto:" & Server.HTMLEncode(Request.Form("email")) & "'>"
    objFile.Write Server.HTMLEncode(Request.Form("email")) & "</a></font><br><font size='1'>"
    objFile.Write now & " - ip address:"
    objFile.Write (request.servervariables("remote_Addr")) & "</font></p>"
    objFile.Close
    Set objFSO = Nothing
    Set objFile = Nothing

    I keep getting a Server.CreateObject error, on this line: Set objFile = objFSO.OpenTextFile(strFile, 8, True). I have no clue why that doesn't work.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Posts
    7
    Rep Power
    0
    I forgot. All the other variables in there are defined and work. I made sure of that. The error is somewhere around the create object part. If anyone can solve my problem, I greatly appreciate it!
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    2
    Rep Power
    0
    I dont know why you are using a text file for a database...i recommend using access. Its easier to query data and display it. I would rewrite the script for a access database. If you need anyhelp with asp or access email me at frank_17@hotmail.com

IMN logo majestic logo threadwatch logo seochat tools logo