Access 2003. I am maintaining 5 almost identical databases (long story). Each of them is split into a back end and front end. While individual maintenance of the back ends is inevitable, I would really like to maintain just one front end that users could use to link to the back end of their choice. The problem is that they would not be comfortable using Access's table-linking function and I would not want them to. I have an Enter Defaults window that requires users to select the product they are working with. I would like to use this parameter to drive some code that selects and links the front end dynamically to the appropriate back end at run time, transparently to the user. Is this possible with Access? If so, can you provide an example? I am no VB whiz, but if I have a basic example, I can usually "reverse engineer" it and figure out where to go from there.
Thanks for any help. You guys are an invaluable resource and I'm glad you're here!
LW
2 2042 ADezii 8,834
Recognized Expert Expert
Access 2003. I am maintaining 5 almost identical databases (long story). Each of them is split into a back end and front end. While individual maintenance of the back ends is inevitable, I would really like to maintain just one front end that users could use to link to the back end of their choice. The problem is that they would not be comfortable using Access's table-linking function and I would not want them to. I have an Enter Defaults window that requires users to select the product they are working with. I would like to use this parameter to drive some code that selects and links the front end dynamically to the appropriate back end at run time, transparently to the user. Is this possible with Access? If so, can you provide an example? I am no VB whiz, but if I have a basic example, I can usually "reverse engineer" it and figure out where to go from there.
Thanks for any help. You guys are an invaluable resource and I'm glad you're here!
LW
What you are requesting is definately possible using VBA. Give me a little time,and I'll post a code template for you.
ADezii 8,834
Recognized Expert Expert
Access 2003. I am maintaining 5 almost identical databases (long story). Each of them is split into a back end and front end. While individual maintenance of the back ends is inevitable, I would really like to maintain just one front end that users could use to link to the back end of their choice. The problem is that they would not be comfortable using Access's table-linking function and I would not want them to. I have an Enter Defaults window that requires users to select the product they are working with. I would like to use this parameter to drive some code that selects and links the front end dynamically to the appropriate back end at run time, transparently to the user. Is this possible with Access? If so, can you provide an example? I am no VB whiz, but if I have a basic example, I can usually "reverse engineer" it and figure out where to go from there.
Thanks for any help. You guys are an invaluable resource and I'm glad you're here!
LW
Here is your Code Template based on the following assumptions: __1. Combo Box containing the Back End Database Names is called cboLink __2. The 5 Back End Database Names are Back End 1 to Back End 5 __3. Notice that this code is called from the AfterUpdate Event of cboLink __4. Any questions, feel free to ask - Dim strDBPath As String, strTableName As String, LinkedDB As Database
-
Dim tbfLinked As TableDef, MyDB As DAO.Database, Mytdf As DAO.TableDef
-
Dim Response As Integer, strPrompt As String
-
-
strPrompt = "Do you wish to Re-Link to the " & Me![cboLink].Value & " Database?"
-
Response = MsgBox(strPrompt, vbQuestion + vbYesNo + vbDefaultButton1, "Relink Tables")
-
If Response = vbNo Then Exit Sub
-
-
Set MyDB = CurrentDb()
-
-
Select Case Me![cboLink]
-
'e.g. C:\Databases\MASTER\Test.mdb
-
Case "Back End 1"
-
strDBPath = "Path to Back End 1"
-
Case "Back End 2"
-
strDBPath = "C:\Dell\Employees.mdb" 'Test Path
-
Case "Back End 3"
-
strDBPath = "Path to Back End 3"
-
Case "Back End 4"
-
strDBPath = "Path to Back End 4"
-
Case "Back End 5"
-
strDBPath = "Path to Back End 5"
-
End Select
-
-
' Create Microsoft Jet Workspace object.
-
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
-
-
' Open Database object from saved Microsoft Jet database
-
' for exclusive use (True)
-
Set LinkedDB = wrkJet.OpenDatabase(strDBPath, True)
-
-
'Delete all existing Tables, except System, in preparation for re-linking.
-
'Also, Delete 'only' Linked Tables (Len(Connect) > 0)
-
For Each Mytdf In MyDB.TableDefs
-
If Left$(Mytdf.Name, 4) <> "MSys" And Len(Mytdf.Connect) > 0 Then
-
MyDB.TableDefs.Delete Mytdf.Name
-
End If
-
Next
-
-
For Each tbfLinked In LinkedDB.TableDefs
-
'Filter out the System Tables
-
If Left$(tbfLinked.Name, 4) <> "MSys" Then
-
'Do the actual Linkage
-
DoCmd.TransferDatabase acLink, "Microsoft Access", strDBPath, acTable, tbfLinked.Name, tbfLinked.Name, False
-
End If
-
Next
-
LinkedDB.Close
-
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Matt |
last post by:
I always heard people saying IIS ASP front end, and MS-SQL back end. ASP is
for server side programming and dynamic content generation, how could it is
called front end? Because I thought it is executed in the server, which is
back end? I think I am confused with the term front end and back end here.
Please advise. Thanks!!
|
by: Ian Baker |
last post by:
We have been developing in MS Access/VBA for nearly 10 years now and find we
need to get with the times and look at a web type of front end to a more
robust/multi user back end.
I would be interested to here any thoughts on which way we should go. We
currently have an IT Help Desk application that we need to duplicate in new
technology (example at http:jackaroo.net.au) which needs to be able to have
many users eg Corp wide and to handle...
|
by: Yannick Turgeon |
last post by:
Hello,
We are in the process of examining our current main application. We have to
do some major changes and, in the process, are questionning/validating the
use of MS Access as front-end. The application is relatively big: around 200
tables, 200 forms and sub-forms, 150 queries and 150 repports, 5GB of data
(SQL Server 2000), 40 users.
I'm wondering what are the disadvantages of using Access as front-end? Other
that it's not...
|
by: Alex |
last post by:
Is there any way to link a table to a front end for reference only (no
requirement to edit data) so that the LDB file is not created.
I use a number of tables for reference and do not need to edit them. I
read some of the table values. The form that is displayed does not use
any of the data in the reference tables.
Alex
|
by: robert d via AccessMonster.com |
last post by:
I was asked to provide a proposal. I provided a proposal on my application
and the prospective client likes what I have but is wary of it having been
developed in Access.
I don't understand this concern since my front-end application will be linked
to a SQL SERVER backend.
But there seems to be this "conventional wisdom" among IT people that Access
is a toy database. Okay, let's redefine that as "Jet" is a toy database
(which I don't...
| |
by: rdemyan via AccessMonster.com |
last post by:
I'm having a complicated linking problem. Before I get into the particulars,
I'd like to know how Access links to the back-end file at startup, AFTER I've
distributed my application to the client.
Here's the issue. While I'm working on my app, I'm linked to the backend on
my computer. When I distribute the app, the backend file is obviously in a
different location (on the client server).
But the first time my app is started up at...
|
by: idsanjeev |
last post by:
<%@ Language =vbscript%>
<% Option Explicit %>
<html>
<head><TITLE>VOICE OF BARAUNIANS</TITLE></head>
<body>
<!--#include file="front.inc"-->
<div style="Position:Absolute; width:700; TOP:0; left:180; background-color:#f0f0f0">
<%
Dim conn
dim objrs
|
by: Ian |
last post by:
I have an Access 2000 database split front back end, what I want to do
is have some kind of web based front end so users can logon via the
internet and:
1. Enter new records, edit records in the database
2. Apply a filtering systems where records on a report can be limited to
those matching a criteria, then print or PDF this filtered report
including associated pictures.
|
by: zion4ever |
last post by:
Hello good people,
Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet reservation of available resources (laptops, beamers, etc). The MySql database queries are already in place, as is the ASP administration panel. The frontend that users will see however, still needs some work. I'm really close, but since I'm no...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |