By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

Attaching files to an Access db

P: n/a
I know that you can format url's withing an Access database but can you
physically attach Word, Excel or pdf files within one? I need to attach
backup documents into a database I am creating. Any suggestions for a
workaround or alternative solution? Thanks

Mark
Oct 31 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Mark" <m.*******@snet.netwrote in
news:hR***************@newssvr12.news.prodigy.com:
I know that you can format url's withing an Access database but
can you physically attach Word, Excel or pdf files within one? I
need to attach backup documents into a database I am creating. Any
suggestions for a workaround or alternative solution?
There are OLE fields which allow you to embed the data in a table,
but that's not really very useful and bloats the database a great
deal. The only situation where I ever found it useful was in a
replicated environment, where two sites needed to share the same
documents.

Otherwise, I just store a path -- I don't even use hyperlinks (too
much trouble with the formatting/editing).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Oct 31 '06 #2

P: n/a
"David W. Fenton" <XX*******@dfenton.com.invalidwrote in
news:Xn**********************************@127.0.0. 1:
"Mark" <m.*******@snet.netwrote in
news:hR***************@newssvr12.news.prodigy.com:
>I know that you can format url's withing an Access database
but can you physically attach Word, Excel or pdf files within
one? I need to attach backup documents into a database I am
creating. Any suggestions for a workaround or alternative
solution?

There are OLE fields which allow you to embed the data in a
table, but that's not really very useful and bloats the
database a great deal. The only situation where I ever found
it useful was in a replicated environment, where two sites
needed to share the same documents.

Otherwise, I just store a path -- I don't even use hyperlinks
(too much trouble with the formatting/editing).
I've done it both ways. OLE fields are a PITA, Just storing the
path is also a problem when users move files.

So now I ask the user for the filename, and a description of
file contents, parse out the file extension, then assign a new
file number to the record, and copy the file to a subdirectory
specifically set up for the purpose.

Dim stSourceFile as string
dim stFileExtension as string
Dim stCopyOfFile as string
Const stStoreDirectory as string = "C:\Database\Attachments\"

stSourceFile = fGetSaveFile() ' from mvps or somewhere
stCopyOfFile = Me.ID ' grab the autonumber
stFileExtension = right(stSourcefile,4)

FILECOPY stsourcefile, _
stStoreDirectory _
& stCopyOfFile _
& stfileExtension

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Oct 31 '06 #3

P: n/a
Bob, so it can be done! Where do I embed that code? Would it be a reference
within record say a field called Attachments or something? I am going to
save these files on a network server so users can access them from where
ever they are. Thanks
"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
"David W. Fenton" <XX*******@dfenton.com.invalidwrote in
news:Xn**********************************@127.0.0. 1:
>"Mark" <m.*******@snet.netwrote in
news:hR***************@newssvr12.news.prodigy.com :
>>I know that you can format url's withing an Access database
but can you physically attach Word, Excel or pdf files within
one? I need to attach backup documents into a database I am
creating. Any suggestions for a workaround or alternative
solution?

There are OLE fields which allow you to embed the data in a
table, but that's not really very useful and bloats the
database a great deal. The only situation where I ever found
it useful was in a replicated environment, where two sites
needed to share the same documents.

Otherwise, I just store a path -- I don't even use hyperlinks
(too much trouble with the formatting/editing).

I've done it both ways. OLE fields are a PITA, Just storing the
path is also a problem when users move files.

So now I ask the user for the filename, and a description of
file contents, parse out the file extension, then assign a new
file number to the record, and copy the file to a subdirectory
specifically set up for the purpose.

Dim stSourceFile as string
dim stFileExtension as string
Dim stCopyOfFile as string
Const stStoreDirectory as string = "C:\Database\Attachments\"

stSourceFile = fGetSaveFile() ' from mvps or somewhere
stCopyOfFile = Me.ID ' grab the autonumber
stFileExtension = right(stSourcefile,4)

FILECOPY stsourcefile, _
stStoreDirectory _
& stCopyOfFile _
& stfileExtension

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com


Nov 3 '06 #4

P: n/a
"Mark" <m.*******@snet.netwrote in
news:%o*****************@newssvr12.news.prodigy.co m:
Bob, so it can be done! Where do I embed that code? Would it
be a reference within record say a field called Attachments or
something? I am going to save these files on a network server
so users can access them from where ever they are. Thanks
The code would need some cleaning up before embedding it
anywhere, and where to embed it depends on several factors
pertinent to the specific needs of the database

In order to handle multiple attachments to a single main record,
I would probably build a separate table, with three fields,
specifically an autonumber primary ID, a field to store the
primary key of your main table, and a description field.
I'd then create a form or more likely a subform to the main
table's form that shows the existing attachments and a button to
open one. If the subform was on a new record, the button would
instead prompt the user to get the new attachment and then
execute the code snippet below, or some similar code.

The code below doesn't do anything to create the new record, or
populate the fields.Its purpose was to handle the specific
action of opening Windows File Dialog, then copy the file.
>
"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
>"David W. Fenton" <XX*******@dfenton.com.invalidwrote in
news:Xn**********************************@127.0.0 .1:
>>"Mark" <m.*******@snet.netwrote in
news:hR***************@newssvr12.news.prodigy.co m:

I know that you can format url's withing an Access database
but can you physically attach Word, Excel or pdf files
within one? I need to attach backup documents into a
database I am creating. Any suggestions for a workaround or
alternative solution?

There are OLE fields which allow you to embed the data in a
table, but that's not really very useful and bloats the
database a great deal. The only situation where I ever found
it useful was in a replicated environment, where two sites
needed to share the same documents.

Otherwise, I just store a path -- I don't even use
hyperlinks (too much trouble with the formatting/editing).

I've done it both ways. OLE fields are a PITA, Just storing
the path is also a problem when users move files.

So now I ask the user for the filename, and a description of
file contents, parse out the file extension, then assign a
new file number to the record, and copy the file to a
subdirectory specifically set up for the purpose.

Dim stSourceFile as string
dim stFileExtension as string
Dim stCopyOfFile as string
Const stStoreDirectory as string = "C:\Database\Attachments\"

stSourceFile = fGetSaveFile() ' from mvps or somewhere
stCopyOfFile = Me.ID ' grab the autonumber
stFileExtension = right(stSourcefile,4)

FILECOPY stsourcefile, _
stStoreDirectory _
& stCopyOfFile _
& stfileExtension

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com





--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Nov 3 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.