Avatar of peispud
Flag for Canada asked on

Best practice to save just one piece of information that might rarely change.


My application will generate PDF's.     Those PDF's will almost certainly be always saved the same chosen folder.   But a different user may want to choose another folder.
So, what is the best way to save the file path (string)?

1) I could store the path string to a constant.    This is OK for me, but not for a non-programmer.  
2) I could create a  table with one record and one field.      If I wrote code around that, then the other users could change & store the information.  
3) I could create XML file.    But now, I would have to do some coding to handle a situation where the XML file was not there  (for various reasons).

Is there a better solution?
Microsoft Access

Avatar of undefined
Last Comment
John Tsioumpris

8/22/2022 - Mon

For a lot of my MS Access applications that have connections to a SQL Server back-end I store the SQL connection strings in a table with two fields, one for the PROD conn string and one for the TEST/DEV conn string.  I have a function in VBA to change the application's connection to the back-end db using one or the other conn strings.
This works for me.  The conn string is rarely changed once the app is deployed but allows me, or a user, to change it if necessary.
Dale Fye

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.


Thank you for your quick reply.
Your assistance has been appreciated.
John Tsioumpris

Another solution not mentioned is to use a different DB engine just for storing the PDFs as Blobs ...probably Firebird.

So no more chasing folders.

In the proposed solution i would modify it like this

Table :

      ID                      User(PK)         Application (PK)   File (PK)        Location   SaveActionDate                

AutoNmbr          Number             Number                     Number       Text        Date                           

So for every save action you log which user from which application saved the particular PDF to which location and when.

I assume that your PDFs have some kind of uniqueness so the exact filename would be saved them to a separate table. (ID, FileName)

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck