Microsoft
Software
Hardware
Network
Question : Change table source for queries based on user or machine access
Experts:
I have two sets of users at my company. Users in set A have access to ODBC drivers to get link to the source machine that has the raw data that all of my queries and reports are based on. Users in set B do not have ODBC access and require text imports of data to local tables (not realtime, slower). I have setup the processes for the users in set B to and the imports happen as they should.
At the moment, I am maintaining two separate databases with identical forms, reports, etc. except that, for example, in set A the customer table is defined as an odbc link and in set B the customer table is an actual table of data which resides in the file.
I have the ability to determine which group the user is in based on their ip address. I could base the solution on thier ip address.
I have dozens of queries that are based on dozens of tables which are named identically in the two databases. In addition, many of the queries are 'chained together' - i.e. query test3 is based on query test2 whcih is based on query test1 which is based on data from 6 tables which are all ODBC tables in Set A and which are all regular tables in set B.
Rather than having two separate databases, is there a way to manipulate my queries to change the tables they are based on depending on the machine.
I thought of using Union queries - i.e. renaming the customer table through odbc customer-odbc & renaming the customer table from the non-odbc version customer-non-odbc in the same file. Then creating a query called customer as a union query, but the union query will fail on the non-odbc machine when it attempts to execute and would be a slow solution even if it did.
Additionally, since the users do not have the ability to change the queries permanently (they are databases which are being used in a multi-user enviornment), I do not want to write changes to the database in real time because that could affect the next user.
Any help would be appreciated,
Joe
Answer : Change table source for queries based on user or machine access
Hi Joe,
in principle you can do already now a single-source policy:
A. You maintain one seperate developerversion.
In that developerversion you implement a VBA code for "deploy"
this code produces automatically the A and B version (it will be a little bit tricky but i think its possible)
B. You put a code in the autoexec-macro, which looks for some local resource (e.g. a registry-entry for correct odbc setting, or most simple a local textfile ) to determine which links the tables have to get and set them automatically.
C. You make it completely flexible by putting the individual apropiate paths to a localdata.mdb from where at startup the backend-tablelinks are automatically set.
Regards, Franz
Random Solutions
Textboxes in other Tabs in asp.net
Unrecognized database format
SBS 2008 iis7 problem
Access VBA
CREATE AN MSDOS BOOT CD FOR ACRONIS, KNOPPIX, GHOST, WINDOWS XP REPAIR CONSOLE!
Division & OLAP Cubes
Unable to set break point
Getting Microsoft.Win32.RegistryKe<wbr />y from PROFILEINFO.hProfile - from PInvoke to .Net
Best way to push out printers to domain users?
Want to open form when file opens, but getting file/access error 75 message