Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Attaching a word doc in asp email code

Posted on 2004-04-30
7
Medium Priority
?
714 Views
Last Modified: 2008-01-16
I am puzzled experts.

My asp code is dumping the contents of a db file into a word doc and
then creates a file on the web root directory per code below.

Problems I am running are:

1, If I created a field name called filename on the db specifically to be the name of doc file being create.
I then hardcoded the value for this field.
The whole idea is when this file is created on a folder, it will have that name like notify.doc

When I run this one line of code below, I get the error permission denied.

file_being_created= rs("filename") & ".doc"

Microsoft VBScript runtime (0x800A0046)
Permission denied

I don't know why because code below should overwrite a doc file if it already exists.

Set act = fso.CreateTextFile(server.mappath(file_being_created), true)


The other error occurs when I change file_being_created to autonumber on the db.
If I change the file_being_cr
file_being_created= rs("ID") & ".doc"
CDO.Message.1 (0x80070002)
The system cannot find the file specified.



Flds.Update
With iMsg
 Set .Configuration = iConf
     .From = "web Admin <domain.com>"
     .To = "domain.com"
     .AddAttachment("\\dw6\Reports\file_being_created")
     .AddAttachment("\\dw6\Reports\logo.gif")
     .Sender      = "web Admin <domain.com>"
     .Subject     = "New Information"
     .TextBody    = "Attached is a word document added to the database. "
       .Send
End With

Any help would be appreciated.
0
Comment
Question by:simflex
  • 4
  • 3
7 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 10963906
Do the IUSR_ and IWAM_ accounts have READ/WRITE access to this directory?

FtB
0
 

Author Comment

by:simflex
ID: 10976660
hi Fritz!
My response is coming late because I couldn't gain access to our network this past weekend.
So rather than guess an answer to your question, I decided to wait to verify first.
In any case, the answer to your question is yes.
Again, when I use autonumber, instead of the filename I created on the db, I get an error that system could not find file.
I get that error message because the .doc file was not getting created.
If I use the filename, I get an error that permission is denied.
Either way, I am not being allowed to create this file.
Any help in resolving this would be greatly appreciated.
I am giving a demo this pm and so it would be great if I could show them that this is working.
0
 

Author Comment

by:simflex
ID: 10985933
can anyone here please assist me with this problem?
Thanks in advance
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 10986410
As I said above, if the IUSR and IWAM don't have proper permissions, the file will not get written.

FtB
0
 

Author Comment

by:simflex
ID: 10995446
I have given IUSR and IWAM accounts full permissions on everything but yet I still get this error:

Error Type:
CDO.Message.1 (0x80070020)
The process cannot access the file because it is being used by another process.
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 150 total points
ID: 10995577
That is progress, I suppose. At least know the file is being created. Can you verify that is the case by watching the appropriate directory on your server?

Fritz the Blank
0
 

Author Comment

by:simflex
ID: 10995861
Yes, the file is being create.
The hangup now is getting my email program to pick it up and send it out.
That is where the problem is right now.
Thanks for the assistance
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question