ASP geniuses...

This is a discussion on ASP geniuses... within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Ok, I'm using 7host.com, and I keep getting errors on this ASP code: Code: <html> <head> <title>Welcome</title> </head> <body> hi, ...

  1. #1
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230

    ASP geniuses...

    Ok, I'm using 7host.com, and I keep getting errors on this ASP code:

    Code:
    <html>
    <head>
    <title>Welcome</title>
    </head>
    <body>
    hi, currently stored values are:
    
    <%
    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    
    set fso = server.CreateObject("Scripting.FileSystemObject")
    set File = fso.GetFile("D:/user/kenasp/root/storage.txt") 
    set ts = File.OpenAsTextStream(ForReading, -2)
    
    Do While not ts.AtEndOfStream
         myText = myText & ts.ReadLine & vbCrLf
    Loop
    
    Response.Write(myText)
    %>
    <form action = "index.asp">
    <input type = "text" name = "text">
    <input type = "submit" name = "input" value = "Ok">
    </form>
    <%
    Set FileName = "D:/user/kenasp/root/storage.txt"
    
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    Set ConfigFile = Server.MapPath(FileName)
    Set TheFile = fso.OpenTextFile(ConfigFile, 2)
    
    TheFile.write Request.QueryString("text") & vbCrLf
    TheFile.Close
    %>
    </body>
    </html>
    I even setup a default storage.txt file. can anyone help out? I'm totally at a loss for what's wrong.

  2. #2
    Registered User mfc2themax's Avatar
    Join Date
    Aug 2001
    Posts
    346
    what specific errors?
    mfc2themax-Creator of all that is.

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    ASP isn't like C. you don't get compiler errors...you don't run it through a compiler. But with 7host.com it won't load the page if it has errors...and my page won't load.

  4. #4
    Red Panda basilisk's Avatar
    Join Date
    Aug 2001
    Posts
    219
    hi ken
    i hope you dont mind but i set this script up at home to run as i have my own web server.. i set up the same directory structure to your storage.txt but used c: instead of d: and this is the error i got:

    Microsoft VBScript runtime (0x800A01A8)
    Object required: '[string: "c:/user/kenasp/root/"]'
    /test/test.asp, line 28

    line 28 is looking at the line:
    Set FileName = "c:/user/kenasp/root/storage.txt"

    i have only started teaching myself asp so not too much idea of a fix but if you try the following site they may be able to help as they are dedicated to ASP and there is some pretty good stuff on there, and also a forum (i did see a number of people having problems with mappath):

    http://www.asp101.com/
    Do not meddle in the ways of dragons, for thou art crunchy and taste good with ketchup

  5. #5
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    thanks, that helps a little. I'll try that site, too.

  6. #6
    Registered User mfc2themax's Avatar
    Join Date
    Aug 2001
    Posts
    346
    mfc2themax-Creator of all that is.

  7. #7
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    why are you using d:/ ?
    Is there a d:/ directory?
    Do you know the directory structure of the server?
    Maybe that's the problem.
    Just my first guess.
    I'd say it's better to use relative paths if you can.

    I did an ASP project last spring so I'm a bit familiar.

  8. #8
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    hold up...does ASP support come with the free web site account at 7host.com, or do you have to get one of the ones where you have to pay?
    My Website

    "Circular logic is good because it is."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with ASP
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-20-2002, 08:13 PM
  2. ASP pages with VS.NET
    By Korn1699 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 03-27-2002, 08:42 AM
  3. sending email from (C++)exe file through ASP
    By priya in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2002, 09:14 AM
  4. New Tnet page - supports ASP !!!!
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 10-26-2001, 08:23 AM
  5. ASP troubles
    By -KEN- in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 09-30-2001, 04:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21