Relink ODBC Tables trough VBA (1 Viewer)

LeoM

Member
Local time
Today, 09:58
Joined
Jun 22, 2023
Messages
41
Good afternoon everyone. Having a FrontEnd MS Access DB (shared with users) with one linked ODBC Table (located in another separate database) I'm looking to a function who can reconnect that ODBC Table when the end user doesn't have any DSN. This because I would like to avoid to create a DSN on each end user i share the FrontEnd. I have all necessary information (server name, uid, psw, etc). Any suggestion please ? I tried to look around but, or I don't understand ho to do or I cannot use.
Cheers.
 

Josef P.

Well-known member
Local time
Today, 10:58
Joined
Feb 2, 2023
Messages
826
You can use a DSN less connection string.

Note: if you store the password in the connection string of the linked table, it can be read with little effort.
 

LeoM

Member
Local time
Today, 09:58
Joined
Jun 22, 2023
Messages
41
Thank you for answer, yes i saw it but is not clear to me. It could be possible to get an example of reconnection in a small vba function? Thanks.
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:58
Joined
Sep 21, 2011
Messages
14,301
Each has their own copy on their computer, never shared.
 

LeoM

Member
Local time
Today, 09:58
Joined
Jun 22, 2023
Messages
41
Each has their own copy on their computer, never shared.
Apologies, when i mentioned "shared", i mean that i share with each of them a local FE DB. I understood that the "shared" word maybe is not the correct one.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:58
Joined
Feb 19, 2002
Messages
43,275
Individual users should NEVER be relinking the BE. When you upload the new FE to the master folder on the server, you relink the tables at that time. It is far better to use the UNC format -- \\servername\foldername\database_BE.accdb Rather than using specific drive letters. When you use specific drive letters, you may run into trouble if you have a lot of mapped drives and you don't use consistent drive letters. So, if you have a bunch of users and a bunch of drives, you might end up with not being able to find a drive letter that is available on every workstation.
 

LeoM

Member
Local time
Today, 09:58
Joined
Jun 22, 2023
Messages
41
Individual users should NEVER be relinking the BE. When you upload the new FE to the master folder on the server, you relink the tables at that time. It is far better to use the UNC format -- \\servername\foldername\database_BE.accdb Rather than using specific drive letters. When you use specific drive letters, you may run into trouble if you have a lot of mapped drives and you don't use consistent drive letters. So, if you have a bunch of users and a bunch of drives, you might end up with not being able to find a drive letter that is available on every workstation.
Thank you, absolutely yes, I do exactly like that exactly to avoid problems with different network drive letters setting. Usually I prepare the interface with linked table (using the structure \\servername\......) and than I locate it in a specific folder where the users will copy and paste in their own local drive. Cheers.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:58
Joined
Feb 19, 2002
Messages
43,275
So, each user has his own BE? That's unusual.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:58
Joined
Feb 19, 2002
Messages
43,275
OK, then the link happens only once when you first distribute the FE. The users never have to link again.
 

Users who are viewing this thread

Top Bottom