Bound ComboBox to external database (1 Viewer)

Capitala

Member
Local time
Today, 09:58
Joined
Oct 21, 2021
Messages
58
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

  • db1.accdb
    384 KB · Views: 394
  • db2.accdb
    576 KB · Views: 394

CJ_London

Super Moderator
Staff member
Local time
Today, 09:58
Joined
Feb 19, 2013
Messages
16,610
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: 364

Capitala

Member
Local time
Today, 09:58
Joined
Oct 21, 2021
Messages
58
Thanks, I'll work in it. Kindly let me revert to you later
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:58
Joined
May 7, 2009
Messages
19,241
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

Top Bottom