Bound ComboBox to external database

Capitala

Member
Local time
Today, 15:58
Joined
Oct 21, 2021
Messages
91
I have two databases; one for forms (db1) and the other (db2) where I kept my tables (protected with password)
Now, I need to bound data in a form; form or sub-form recordsource, combobox, listbox ...etc. to that external database without linking tables.
NB: linking tables will enable the user by a way or another to access the tables and update them manually.
Attached both files. db2 password= 12345
Thanks in advance
 

Attachments

If you are not looking for a fully secured system then the essence of what you need would be your form recordsource or control rowsource to have sql along the lines of

Code:
SELECT *
FROM myTable  IN '' [ms access;pwd=password;Database=C:\path\BE filename.accdb];

note the two single quotes

an alternative for single tables is
Code:
SELECT *
FROM [ms access;pwd=password;Database=C:\path\BE filename.accdb].myTable

both of which will produce an updateable query

During development, you could link your tables and having got your query working as required, put the connection string in the query properties
1635981469542.png

then copy the sql to your record/row source. Then you can delete the query and linked tables. So when you create your .accde the sql containing the password is not available to users. And the FE does not contain any tables or queries

However do note that this can be easily 'discovered' even with .accde by someone who knows how to look for it. If you want higher security, then take note of Colin's examples
 

Attachments

  • 1635981253951.png
    1635981253951.png
    8.7 KB · Views: 416
Thanks, I'll work in it. Kindly let me revert to you later
 
If the link given by the DBGuy looks worth following up,
it will require you much code, and i doubt if the man will just throw his code without any price?
use suggestion on post #4.
 

Users who are viewing this thread

Back
Top Bottom