Avatar of peispud
peispudFlag for Canada

asked on 

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

Hi.

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
Avatar of omgang
omgang
Flag of United States of America image

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.
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
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
Avatar of peispud
peispud
Flag of Canada image

ASKER

HI.

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

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)


Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo