SendObject sends out multiple wrong files

H

hmbhuss1

We have a system where numerous Access databases send out excel files to
clients automatically using the DoCmd.SendObject command. (We also have
databases which use the Outlook API and CDO but the failure here occurred on
one using the SendObject command). We had an email go out with 4 attachments
on it. One attachment was appropriate to the database that send the email
but the other 3 attachements were from databases that had sent out files the
previous day. Additionally, the other 3 Excel files had been renamed to have
the name of the query that was being sent out by the database with _tbl1,
_tbl4 and _tbl8 appended onto their name, before the .xls. So the query
going out was called Client_New08_tbl.xls. The other files were
Client_New08_tbl1.xls, Client_New08_tbl4.xls and Client_New08_tbl8.xls.

We found the actual excel files that these came from and they had all been
made in a 10 minute period on the previous day. Just prior to that time
about 25 of these databases all stacked up and I had to crash them and re-run
them manually. Looking at the Temp folder after the multiple file email had
gone out, I noticed 2 CDB*.tmp files sitting there. These appear to be the
temp files that send object makes when it is creating the excel file to
attach to the email (I'm guessing). I'm wondering if in this crash there
were temp files left in the folder that had the same name as the temp file
that was being made the next morning, but beyond that I have no clue as why
they would get renamed and attached.

Any help would be greatly appreciated.
 
R

Roger Carlson

Since Access 2000 SR1, SendObject has been unreliable. See the following MS
Knowledgebase article:
http://support.microsoft.com/default.aspx?scid=KB;en-us;q260819

Better to use Outlook Automation or Blat. For an example of Blat, look
here:
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Tapia,Francisco

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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

Top