473,788 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Link front end to back end at run time based on user input

lwwhite
16 New Member
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
Apr 4 '07 #1
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.
Apr 4 '07 #2
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
Expand|Select|Wrap|Line Numbers
  1. Dim strDBPath As String, strTableName As String, LinkedDB As Database
  2. Dim tbfLinked As TableDef, MyDB As DAO.Database, Mytdf As DAO.TableDef
  3. Dim Response As Integer, strPrompt As String
  4.  
  5. strPrompt = "Do you wish to Re-Link to the " & Me![cboLink].Value & " Database?"
  6. Response = MsgBox(strPrompt, vbQuestion + vbYesNo + vbDefaultButton1, "Relink Tables")
  7.   If Response = vbNo Then Exit Sub
  8.  
  9. Set MyDB = CurrentDb()
  10.  
  11. Select Case Me![cboLink]
  12.   'e.g. C:\Databases\MASTER\Test.mdb
  13.   Case "Back End 1"
  14.     strDBPath = "Path to Back End 1"
  15.   Case "Back End 2"
  16.     strDBPath = "C:\Dell\Employees.mdb"     'Test Path
  17.   Case "Back End 3"
  18.     strDBPath = "Path to Back End 3"
  19.   Case "Back End 4"
  20.     strDBPath = "Path to Back End 4"
  21.   Case "Back End 5"
  22.     strDBPath = "Path to Back End 5"
  23. End Select
  24.  
  25. ' Create Microsoft Jet Workspace object.
  26. Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
  27.  
  28. ' Open Database object from saved Microsoft Jet database
  29. ' for exclusive use (True)
  30. Set LinkedDB = wrkJet.OpenDatabase(strDBPath, True)
  31.  
  32. 'Delete all existing Tables, except System, in preparation for re-linking.
  33. 'Also, Delete 'only' Linked Tables (Len(Connect) > 0)
  34. For Each Mytdf In MyDB.TableDefs
  35.   If Left$(Mytdf.Name, 4) <> "MSys" And Len(Mytdf.Connect) > 0 Then
  36.     MyDB.TableDefs.Delete Mytdf.Name
  37.   End If
  38. Next
  39.  
  40. For Each tbfLinked In LinkedDB.TableDefs
  41.   'Filter out the System Tables
  42.   If Left$(tbfLinked.Name, 4) <> "MSys" Then
  43.     'Do the actual Linkage
  44.     DoCmd.TransferDatabase acLink, "Microsoft Access", strDBPath, acTable, tbfLinked.Name, tbfLinked.Name, False
  45.   End If
  46. Next
  47. LinkedDB.Close
  48. End Sub
Apr 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
5283
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!!
6
2477
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...
49
14359
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...
4
6755
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
35
2567
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...
12
5745
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...
1
2272
idsanjeev
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
3
1723
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.
4
4588
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...
0
9656
marktang
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...
0
10373
Oralloy
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...
0
10177
jinu1996
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...
1
10118
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,...
0
9969
tracyyun
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...
1
7519
isladogs
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...
0
5403
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...
1
4074
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
3
2897
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.