Solved

Attaching a word doc in asp email code

Posted on 2004-04-30
7
710 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

630 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