Last edited:
Yes I understand, and this is definitely a possibility
But my intention was to understand if it is possible to use a single Access procedure alternately with different db's, moving from one to another quickly
Tested with firebird 4 and ODBC 2.05.156 => After changing the database in the DSN file, a restart of the Access application was necessary to see data from the other db. Relinking was not necessary.I'm using Access+Firebird while probably Access+SqlServer 'understand' each other better
Tested with firebird 4 and ODBC 2.05.156 => After changing the database in the DSN file, a restart of the Access application was necessary to see data from the other db. Relinking was not necessary.
What does your connection string look like in the linked table?
Code:debug.print currentdb.tablesDefs("YourLinkedTableName").Connect
This is mine:ODBC;FILEDSN=C:\Daten\fb\db.dsn
Well, I don't understand why you have hundreds of tables. Maybe your database design could reduce the number of tables. My biggest database has about 100 linked tables. Relinking those, on rare occasions takes about 10 seconds or so from memory. That's not too long a delay. I imagine if a user was regularly changing the target database, and there were more tables, then a 20 or 30 second delay each time might be irritating for users, hence the suggestion you have permanently linked front ends.
I think it takes slightly longer to link to SQL server databases. Linking to jet/ace back ends seems to be rather faster, maybe a couple of seconds for 50 plus tables.
I have to say 1000 tables sounds a lot. I can't really conceive of an application that would need so many tables. It's not a function of the amount of data. It's a function of designing an appropriate data structure, so that any amount of data can be processed. My system with about 100 tables is for a company with sales in the hundreds of millions."..My biggest database has about 100 linked tables.."
Well, so what?
Do you think db with thousands of tables can't exist?
I don't understand the last paragraph. If you change a named connection to point to a different back end, then this only works if the tables in both backends have the same structure. If they don't then your queries will stop working correctly as fields in those queries will no longer be available.Ok now it works for me too
The sequence to do is:
- connect the db tables the first time (so that Access has the possibility to change the Connect property of each table)
- start the cycle that scrolls through the tables present and those that have the Connect property starting with ODBC: modify it using the ODBC;FILEDSN=C:\file_dsn.dsn (your routine)
At this point, changing the contents of file_dsn.dsn, the data 'seen' by Access will also correspond to those of the modified db
Obviously the two (or plus) different db's must have the identical structure, because Access remembers the structure read during the first connection to the tables
I don't understand the last paragraph. If you change a named connection to point to a different back end, then this only works if the tables in both backends have the same structure. If they don't then your queries will stop working correctly as fields in those queries will no longer be available.
Do you just mean "must" as a requirement that the backends have identical structures
Out of interest how long does it take to modify all the connect properties in your database?
@amorosik
You may find it useful to attend tomorrow's online Access Europe session on Automating DSN-Less Communication to SQL Server.
You may be able to make use of the ideas for your own setup.
For more details, see
Next Access Europe Meeting is on Wed 3 May 2023
The next Access Europe meeting will be on Wednesday 3 May 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central Europe and 10AM in Seattle / PST Please note that the UK is now on Summer Time (UTC+1). For local...www.access-programmers.co.uk
Is that acceptable and better than it was?"..to modify all the connect properties.." if you mean a complete relink of all table, almost 30 sec
Is that acceptable and better than it was?