Missing Default Property, help...

D

dmiller23462

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)


%>
 
M

Manohar Kamath [MVP]

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?
 
D

dmiller23462

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
 
D

dmiller23462

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....
 
D

dmiller23462

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!
 
B

Bob Barrows [MVP]

dmiller23462 said:
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
 
D

dmiller23462

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...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top