473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Link tables by code in Ms Access

Iam using ms access and want to link to another access table name table1 using vb code.

kindly help me on getting code.

Ananth
Sep 12 '08 #1
1 1439
ADezii
8,834 Expert 8TB
This is the simplest Method that I know for dynamically Linking a Table, just substitute your own values for the Constants (Lines 1 to 4). The following code will Link to the Employees Table in C:\Test\Northwind.mdb, the Name of this Table as displayed in your Database Window will be Employees_Local, and will consist of the data as well as the Structure of the Linked Table:
Expand|Select|Wrap|Line Numbers
  1. Const conEXTERNAL_DB_PATH  As String = "C:\Test\Northwind.mdb"
  2. Const conTABLE_TO_LINK As String = "Employees"
  3. Const conLOCAL_TABLE_NAME As String = "Employees_Local"
  4. Const conSTRUCTURE_ONLY As Boolean = False
  5.  
  6. DoCmd.TransferDatabase acLink, "Microsoft Access", conEXTERNAL_DB_PATH, _
  7.                        acTable, conTABLE_TO_LINK, _
  8.                        conLOCAL_TABLE_NAME, conSTRUCTURE_ONLY
  9.  
Sep 13 '08 #2

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

Similar topics

2
by: Jackson | last post by:
I'm having a problem with some .DBF tables and Access 2002. When I try to link them as external data, Access reports "External table is not in expected format", help says the table has changed...
1
by: WillieW | last post by:
Hi folks, I have Access 97 and have set up four tables, each with a Primary Key with a file name manually entered. For example, the four tables relate to information stored in a paper file, on...
3
by: LCalaway | last post by:
Hi, all I have moved a backend/frontend database (2 mdb files) to a different computer, a task done over and over in the past. The location on the second computer has a different path name from...
3
by: debbie | last post by:
I have an Access 2002 program that I install using Wise. The first thing my program does when a front end is opened is re-link, then it checks the version and if needed upgrades the backend. My...
0
by: RLN | last post by:
I have a Microsoft Access2002 database that needs to connect to an Oracle Database. I need to map 2 tables from the Oracle DB to retrieve the proper data. I read somewhere (quite a while back)...
7
by: Lisa | last post by:
I have an Access 2000 application that uses the following function to re-link my tables when I switch from my Current back end to a Dummy back end. I also use it to refresh my links. Function...
13
by: rdemyan via AccessMonster.com | last post by:
My front-end code manually links to the backend file. I was wondering what stops Access from linking to the system tables in the backend file. Is it just by virtue that they are hidden? This...
4
by: sbowman | last post by:
I'm linking a bunch of tables that are in SQL to my Access db and I get the following error on 3 of the tables: "Seq.Group is not a valid name." I tried doing an import instead of a link, but I got...
7
by: ApexData | last post by:
Hello I currently Link the FE/BE using the LinkTables Option and the Linked Table Manager. Any time I need to move the BE to another location, I have to go through this process over again. I...
6
by: Matt | last post by:
Hi All, I have found a version of my answer on GG, but I have not been able to find my exact answer, thus the post. I am using Access 2000 Situation: I have a multi user frontend database...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...

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.