Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Attaching a word doc in asp email code

Posted on 2004-04-30
7
Medium Priority
?
713 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

721 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