Missing Default Property, help...

Discussion in 'ASP General' started by dmiller23462, Jun 4, 2004.

  1. dmiller23462

    dmiller23462 Guest

    Here is the code, it's not complete of course....I've been inserting
    lines as I go to pinpoint the issue.....I understand that the error
    message I'm getting (#185 Missing Default Property) is referring to
    "textfile" but I can't find any information as to what the default
    property SHOULD be....

    By the way, I'm working on an online submission form for our intranet
    that emails several parties AND THEN appends to a text file for later
    viewing by management....I've got the email working, this is the only
    "glitch" or current objective if you will....Any help would be
    great....Thanks in advance...

    <%

    ' Append to a text file

    dim fileobject, textfile

    Set fileobject = CreateObject("Scripting.FileSystemObject")
    Set textfile = fileobject.OpenTextFile(Server.Mappath("/jax/CS/eucs/text/textfile.txt"),
    8, TRUE)


    %>
     
    dmiller23462, Jun 4, 2004
    #1
    1. Advertising

  2. Are you sure the line where you are getting this error is included in your
    post? The two lines you have included look fine to me. Could you please
    include more code, and perhaps the exact line where you are getting this
    error?

    --
    Manohar Kamath
    Editor, .netWire
    www.dotnetwire.com


    "dmiller23462" <> wrote in message
    news:...
    > Here is the code, it's not complete of course....I've been inserting
    > lines as I go to pinpoint the issue.....I understand that the error
    > message I'm getting (#185 Missing Default Property) is referring to
    > "textfile" but I can't find any information as to what the default
    > property SHOULD be....
    >
    > By the way, I'm working on an online submission form for our intranet
    > that emails several parties AND THEN appends to a text file for later
    > viewing by management....I've got the email working, this is the only
    > "glitch" or current objective if you will....Any help would be
    > great....Thanks in advance...
    >
    > <%
    >
    > ' Append to a text file
    >
    > dim fileobject, textfile
    >
    > Set fileobject = CreateObject("Scripting.FileSystemObject")
    > Set textfile =

    fileobject.OpenTextFile(Server.Mappath("/jax/CS/eucs/text/textfile.txt"),
    > 8, TRUE)
    >
    >
    > %>
     
    Manohar Kamath [MVP], Jun 4, 2004
    #2
    1. Advertising

  3. dmiller23462

    dmiller23462 Guest

    I have now figured out in the course of my code bumbling that I *CAN*
    actually append to the file and have done so....What I need to do now
    is to append to the text document the fields that have been input from
    the HTML form....I will include the COMPLETE page code and please let
    me know what I'm missing and how I could go about appending the text
    file with fields input from the form....

    Code is as follows;
    (I have removed certain bits that could be considered "proprietary"
    and "confidential")

    *****

    <%
    Mode = request.form("mode")
    From = request.form("from")
    Ext = request.form("ext")
    Subject = request.form("subject")
    Body = request.form("body")

    if mode = "Send" then

    Set Mail = Server.CreateObject("Persits.MailSender")
    Mail.Host = "*" ' Specify a valid SMTP server
    Mail.From = "*" ' Specify sender's address
    Mail.FromName = "Dave Miller - Test Email" ' Specify sender's name

    if subject = "" then
    Mail.Subject = "Test Email"
    else
    Mail.Subject = subject
    end if

    Mail.AddAddress "dmiller"
    Mail.AddReplyTo "*"
    Mail.IsHTML = True

    Dim mail_body

    mail_body = "Name: " & request.form("name") & "<br>" &_
    "Ext: " & request.form("ext") & "<br>" &_
    "Body: " & request.form("body")

    mail.body = mail_body & "<br>" &
    request.servervariables("REMOTE_ADDR") &
    request.servervariables("LOGON_USER") &
    request.servervariables("REMOTE_USER")

    'Mail.Body = body & vbcrlf & vbcrlf &
    request.servervariables("REMOTE_ADDR")

    On Error Resume Next
    Mail.Send
    If Err <> 0 Then
    Response.Write "Error encountered: " & Err.Description
    End If

    End if
    %>

    <%

    ' Display a text file

    dim fileobject, textfile

    Set fileobject = Server.CreateObject("Scripting.FileSystemObject")
    Set textfile = fileobject.OpenTextFile("D:\Inetpub\JaxWeb\jax\CS\eucs\Text\textfile.txt",
    8)

    %>
    <html>
    <head>

    <title>Comments</title>
    </head>

    <!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->

    <% if mode <> "Send" then %>
    <p>&nbsp;</p>

    <p>This is a template page that will email to certain
    parties and then also append to a file all information submitted
    online</p>

    <form method="POST" action="fileappends_2.asp"
    name="fileappends" onSubmit="validate()">
    &nbsp;<div align="left">
    <table border="0" cellpadding="0" width="782">
    <tr>
    <td width="153">Name:</td>
    <td width="619"><input type="text" name="From"
    size="20"></td>
    </tr>
    <tr>
    <td width="153">Ext.:</td>
    <td width="619"><input type="text" name="Ext"
    size="20"></td>
    </tr>
    <tr>
    <td width="153">Subject:</td>
    <td width="619"><input type="text" name="Subject"
    size="20"></td>
    </tr>
    <tr>
    <td width="153" valign="top">Comments:</td>
    <td width="619"><textarea rows="7" name="Body"
    cols="43"></textarea></td>
    </tr>
    <tr>
    <td width="153" valign="top">&nbsp;</td>
    <td width="619">&nbsp;</td>
    </tr>
    <tr>
    <td width="153" valign="top">&nbsp;</td>
    <td width="619">
    <input type="submit" value="Send Message"
    name="Send"></td>
    </tr>
    </table>
    </div>
    <input type="hidden" name="mode" value="Send">
    </form>
    <script language="vbscript">
    sub validate()
    if trim(len(document.suggest.from.value)) = 0 then
    msg = "Please note that you must provide your name" & vbcrlf & "if
    you'd like to hear back from us for your suggestions..." & vbcrlf &
    vbcrlf & "Continue to send this anonymously?"
    if msgbox(msg, vbYesNo, "Please wait!") <> 1 then
    window.event.returnvalue = false
    document.suggest.from.focus()
    exit sub
    end if
    end if
    end sub
    </script>
    <% end if

    if mode = "Send" and Err = 0 then
    %>
    <h2>&nbsp;</h2>
    <p>The following message has been successfully submitted!</p>
    <p>Name: <font color="#0000FF"> <%=from%></font><br>
    Ext.: <font color="#0000FF"> <%=ext%></font><br>
    Subject: <font color="#0000FF"> <%=subject%></font><br>
    Comments: <font color="#0000FF"> <%=body%></font></p>
    <p>&nbsp;</p>

    <%

    %>
    <%

    Do While textfile.AtEndOfStream = false
    Response.Write(textfile.ReadLine)
    Response.Write("<br>")
    loop

    end if
    %>

    </body>
    </html>
    <!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->

    *****
    END OF CODE

    "Manohar Kamath [MVP]" <> wrote in message news:<#>...
    > Are you sure the line where you are getting this error is included in your
    > post? The two lines you have included look fine to me. Could you please
    > include more code, and perhaps the exact line where you are getting this
    > error?
    >
    > --
    > Manohar Kamath
    > Editor, .netWire
    > www.dotnetwire.com
    >
    >
    > "dmiller23462" <> wrote in message
    > news:...
    > > Here is the code, it's not complete of course....I've been inserting
    > > lines as I go to pinpoint the issue.....I understand that the error
    > > message I'm getting (#185 Missing Default Property) is referring to
    > > "textfile" but I can't find any information as to what the default
    > > property SHOULD be....
    > >
    > > By the way, I'm working on an online submission form for our intranet
    > > that emails several parties AND THEN appends to a text file for later
    > > viewing by management....I've got the email working, this is the only
    > > "glitch" or current objective if you will....Any help would be
    > > great....Thanks in advance...
    > >
    > > <%
    > >
    > > ' Append to a text file
    > >
    > > dim fileobject, textfile
    > >
    > > Set fileobject = CreateObject("Scripting.FileSystemObject")
    > > Set textfile =

    > fileobject.OpenTextFile(Server.Mappath("/jax/CS/eucs/text/textfile.txt"),
    > > 8, TRUE)
    > >
    > >
    > > %>
     
    dmiller23462, Jun 4, 2004
    #3
  4. dmiller23462

    dmiller23462 Guest

    By the way, the text file that I'm referring to will be an "archive"
    file that management can go in and see a history of all submitted
    forms....Figure if I give you an idea of the "bigger picture" it may
    be easier to relate to this particular situation....
     
    dmiller23462, Jun 4, 2004
    #4
  5. dmiller23462

    dmiller23462 Guest

    Ok.....I've got one more issue...I've successfully got the file
    appending with the following lines of code;

    <%

    ' Display a text file

    dim fileobject, textfile

    Set fileobject = Server.CreateObject("Scripting.FileSystemObject")
    Set textfile = fileobject.OpenTextFile("D:\Inetpub\JaxWeb\jax\CS\eucs\Text\textfile.txt",
    8)

    ' Append to the text file

    textfile.writeline Request.form("name")
    textfile.writeline Request.form("ext")
    textfile.writeline Request.form("body")

    ' Close the text file

    textfile.close

    %>

    The issue is that my Internet Explorer browser processes the
    information, emails it to the correct email but then takes
    FOREEEEEVVVVEEERRRR to give me the confirmation page....It just hangs
    and I have to close with Task Manager....It DOES write to the file,
    however....Just hangs...Is there anything obvious in my code that
    could cause it to hang? I made sure to "close" the file after writing
    to it.....Help if possible!
     
    dmiller23462, Jun 7, 2004
    #5
  6. dmiller23462 wrote:
    > Ok.....I've got one more issue...I've successfully got the file
    > appending with the following lines of code;
    >
    > <%
    >
    > ' Display a text file
    >
    > dim fileobject, textfile
    >
    > Set fileobject = Server.CreateObject("Scripting.FileSystemObject")
    > The issue is that my Internet Explorer browser processes the
    > information, emails it to the correct email but then takes
    > FOREEEEEVVVVEEERRRR to give me the confirmation page....It just hangs
    > and I have to close with Task Manager....It DOES write to the file,
    > however....Just hangs...Is there anything obvious in my code that
    > could cause it to hang? I made sure to "close" the file after writing
    > to it.....Help if possible!


    Could it be this?
    http://www.aspfaq.com/show.asp?id=2180
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jun 7, 2004
    #6
  7. dmiller23462

    dmiller23462 Guest

    I've got it working....No locking up anymore....I commented out the
    following code;

    'Do While textfile.AtEndOfStream = false
    'Response.Write(textfile.ReadLine)
    'Response.Write("<br>")
    'loop

    It hasn't hung again....Thanks for all help and I'm sure you'll see
    more posts from me...

    (dmiller23462) wrote in message news:<>...
    > By the way, the text file that I'm referring to will be an "archive"
    > file that management can go in and see a history of all submitted
    > forms....Figure if I give you an idea of the "bigger picture" it may
    > be easier to relate to this particular situation....
     
    dmiller23462, Jun 7, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rb
    Replies:
    1
    Views:
    356
  2. Gary Herron
    Replies:
    2
    Views:
    681
    Bruno Desthuilliers
    Jul 4, 2006
  3. tom c
    Replies:
    0
    Views:
    578
    tom c
    Sep 26, 2006
  4. gwellman
    Replies:
    3
    Views:
    153
    gwellman
    Dec 4, 2003
  5. eddie wang

    Missing Default Property

    eddie wang, Jan 14, 2004, in forum: ASP General
    Replies:
    4
    Views:
    156
    Ray at
    Jan 14, 2004
Loading...

Share This Page