Backend as email attachment

H

Hugh self taught

I have split my database & need to determine the path to the backend file. I
could use the FileOpenSave API but I really need to automate the whole
procedure as the data capturer is not proficient enough. I will then pass the
path to an email message to send me the backend as an attachment. My other
concern is whether the backend can be attached & sent while the database is
open.

Any assistance with this will be gratefully appreciated
 
G

GBA

I do not believe there is any reasonable programmatic way for the FE to find
the location of the BE.

If the user is not able to link tables; then the low brow method is to put
both BE & FE in the same folder - - and insist that the user put that folder
only on their C:

(not inside any other folder). This way the path is always: C:Folder\DB

Yes, the BE can be copied or zipped without affecting the FE and its link.
So you can have the user zip the BE and send it to you any time with no ill
affect...
 
H

Hugh self taught

In my scratching around in forums, I've now made use of the following code
which may be of use to others. Since the Back-end is to be emailed, I rename
it to a .txt extention else outlook blocks the attachment. By default the
user should have the BE in the same folder as the FE. I'll just have to
educate that if they move the database they have to move both files.

My code:

Dim strpath As String
Dim strInputFileName As String
Dim strOutputFileName As String
Dim SourceFile, DestinationFile

strpath = CurrentProject.Path
strInputFileName = "\SADTA_Database_be.mdb"
strOutputFileName = "\SADTA_Database_be.txt"

SourceFile = strpath & strInputFileName ' Define source file name.
DestinationFile = strpath & strOutputFileName ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target.


Thanks for your response as I still wasn't sure about the safety of copying
the BE file.

Should anybody know of a method, I'll appreciate the heads up.

Cheers
 

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