By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,993 Members | 1,883 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,993 IT Pros & Developers. It's quick & easy.

Missing Default Property, help...

P: n/a
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)
%>
Jul 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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" <dm**********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
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)
%>

Jul 19 '05 #2

P: n/a
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]" <mk*****@TAKETHISOUTkamath.com> wrote in message news:<#Y**************@TK2MSFTNGP10.phx.gbl>...
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" <dm**********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
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)
%>

Jul 19 '05 #3

P: n/a
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....
Jul 19 '05 #4

P: n/a
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!
Jul 19 '05 #5

P: n/a
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"
Jul 19 '05 #6

P: n/a
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...

dm**********@yahoo.com (dmiller23462) wrote in message news:<59**************************@posting.google. com>...
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....

Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.