Connect different databases

Only for fun and after some tests, I realized that I could create a query with 50 UNION tables, when I tested the process with 51 an "Expression to complex" error raised.
This limit is stated in Access specifications:
1715501167134.png


However, in many cases other limits may be reached before this point
In any case, I would never advise anyone creating union queries with so many union clauses. It often indicates design issues
 
Last edited:
Why not? Is there some reason a text field is preferable? I always knew not to store lots of OLE Objects or Attachments, but why not just the link?
My guess would be flexibility. Normally most people store only the file name in the data table and the default folder/s locations/s in a settings table. Then you create the full path in a query combining the two. This makes it super easy to move the folders as needed and only update a record or few records for the folder. Then user can do this simply with a folder browser to update the default path/s.

If you store the full path then when you move the folders it becomes a lot harder to update the new locations. A user can probably not do this easily, This requires someone (unlikely a user) to run update queries. I would think this is even more complicated with updating a hyperlink. Hyperlink fields are hard to export and display. They are made up of three parts that all may need to get updated.

Here are some drawbacks to consider. Some are valid, some not so much.
 
My guess would be flexibility. Normally most people store only the file name in the data table and the default folder/s locations/s in a settings table. Then you create the full path in a query combining the two. This makes it super easy to move the folders as needed and only update a record or few records for the folder. Then user can do this simply with a folder browser to update the default path/s.

If you store the full path then when you move the folders it becomes a lot harder to update the new locations. A user can probably not do this easily, This requires someone (unlikely a user) to run update queries. I would think this is even more complicated with updating a hyperlink. Hyperlink fields are hard to export and display. They are made up of three parts that all may need to get updated.

Here are some drawbacks to consider. Some are valid, some not so much.
Thanks.
 
Thanks @MajP you gave Larry my answer and saved me a lot of typing;) There is one more reason and that is if you think the db might ever be converted to SQL Server, the Hyperlink data type is not supported and so you would have to convert the hyperlink to text and change all your code. Since most of my apps get upsized or even start out that way, I can never use the abomination data types even if I think they might be easier.
OK Thanks.
 
To be able to embed the field into a database, you must be able to copy it from its source to the place where your DB file resides. If you can copy it INTO the database file, you can copy it to a set-aside storage place like a sub-folder of the folder where you would have kept the embedded version. So... you just copy the files NEXT TO the DB rather than INTO it. You have enough disk space to contemplate embedding the file on that disk, so you have the same amount of space on the disk to hold the folder and copied (but separate) files.

Also: Within Windows, if you know the device, path, name, and type - that IS the file's sufficiently unique ID that the file system can always find it. Windows files DO have other obscure IDs but device/path/name/type IS unique. If you were thinking about some sort of implied security by hiding the PDFs inside the DB file, Access security is pretty weak. If your users can get to the DB and actually use it, they have enough access to open a dummy database to use as a way to get into your DB files.

You must explain your inability to link PDFs directly, because (not trying to be mean here, but... ) that inability just doesn't make sense. WHY can you not make a hyperlink to a file that would ideally be on the same disk as the database file, and in a folder presumably under your control?

In the meantime, thank you all so much for the replies.

For reasons of privacy of employee files (PDFs), which may contain very sensitive data and which can only be seen by the direct colleague who has to deal with that specific employee, and therefore not allow the rest of the sector (other colleagues) to see all PDFs of all the other employees.

If, for example, a colleague doesn't have any paperwork to do, she/he shouldn't see any employee's PDF.


If I also hide the folder, just do "show hidden files" and they might see them (maybe they don't know it but it could happen).

Or that I put a password (different for each PDF) and then change it after the colleague has finished the work?

(With some VBA code you can't automatically enter the confirmation password to view a PDF, right? :LOL: )
 
For reasons of privacy of employee files (PDFs), which may contain very sensitive data and which can only be seen by the direct colleague who has to deal with that specific employee, and therefore not allow the rest of the sector (other colleagues) to see all PDFs of all the other employees.

Since object-level security was removed from Access maybe in the Ac2003/2007 time range, there is no way to stop someone from getting to those files - if they are determined to do so. Access can be hacked even if you take a great deal of effort that in the process would make the DB nearly useless because of difficulty to use. There is a trade-off here - ease of use vs. protection of data.

Understand that old adage that says that anything Man can do, Man can undo.

You might also consider this scenario: You have an employee PDF. So one of your colleagues works with that employee. A little time passes and the colleague is discovered to have committed a major violation against the company, so gets fired. Now you have this scheme in place that would block others from accessing that file... but SOMEONE has to take over responsibility for processing that employee's issues. So NOW what? Try to not paint yourself into an inescapable corner. The more you overthink this, the more inescapable the dilemma when you discover that a particular colleague was more than slightly fallible.

Or suppose the colleague gets pregnant and eventually takes a 3-month maternity leave, just as the employee needs whatever support colleagues give. NOW what?

Or suppose the employee files a complaint against the colleague and requests a new point of contact. Now what?

Beware of absolute protections because the world in which they are found is NOT absolutely predictable. At some point, you have to be able to trust someone - some PERSON - to make a decision, because programming a ton of logic is a LOT harder than having someone who can just make the decision to override the restriction.

Here is one approach (certainly NOT the only possible approach):

1. Block the place where you put the folders so that only the colleagues can see that. Use Windows group permissions to do this. Talk to your SA or IT admin about setting up a group ID for the colleagues and make the folder for the PDFs be restricted to the colleagues, no access to the general public. This involves NO CODE WHATSOEVER on your part and actually for most security managers is a valid approach.

2. In the code of this DB, you have a field somewhere that holds the ID of the colleague assigned to the case, Then you have the code that would open the PDF just disallow access to that file to any other colleague. This ID would probably be associated with the employee table and could be a small field like an integer ID number. The key is that your code doesn't allow a colleague to set that value.

3. Have a "super-colleague" who can override assignments or make new ones. So... get a new employee, the supervisor assigns a colleague to the case and you're off to the races. Get a new colleague, the supervisor assigns this person some employees just to give them something to do.
 
  • Like
Reactions: Ivy
I presume you could use user logins to secure certain folders.

Then if the user didn't have access to those folders, I presume access wouldn't have access either, for users without the permission. That would prevent a user who could see all the employees opening files for employees he's not entitled to view in detail.

But now you are getting into complicated data security issues, rather than simple database issues.
 

Users who are viewing this thread

Back
Top Bottom