Select and import table between Access files (1 Viewer)

Rakesh935

Registered User.
Local time
Today, 12:14
Joined
Oct 14, 2012
Messages
71
Hi Guys,

I have been asked to work on a project in which I need to select and import a specific table from a access file located in shared drive to an access file located in my local drive.

So far I have always dealt with importing excels files into access and never dealt in importing access table into access files.

I did some google research and found out some codes and post executing the codes I see all the tables in access file located in the shared file getting imported into my local drive access file.

If I have to summarize, I would be needing a browser "import object" in order to select and import a specific table.

Request all, please guide me with your advice.

note: the above process needs to be done through a button control over a form.

Thanks and regards,
Rakesh
 

CJ_London

Super Moderator
Staff member
Local time
Today, 06:44
Joined
Feb 19, 2013
Messages
16,553
why not just link to the table? No import required and always up to date
 

isladogs

MVP / VIP
Local time
Today, 06:44
Joined
Jan 14, 2017
Messages
18,186
Just go to External Tools ... Import ... Access ...
Select your database and you will get a list of database objects - tables / queries etc
You can choose to import or link the tables which is generally better (as CJL has stated)

Alternatively if you open both databases and place them side by side on your desktop, you MAY be able to drag the tables from one to the other (it isn't always possible)
 

Rakesh935

Registered User.
Local time
Today, 12:14
Joined
Oct 14, 2012
Messages
71
Linking would not be a good idea since the access file located in shared folder stores all the tables for 1 day and next day all of them are deleted, since the access file happens to be a data extraction point from another tool (.net application)

Hope I am clear, if not then please let me know.
 

Rakesh935

Registered User.
Local time
Today, 12:14
Joined
Oct 14, 2012
Messages
71
Just go to External Tools ... Import ... Access ...
Select your database and you will get a list of database objects - tables / queries etc
You can choose to import or link the tables which is generally better (as CJL has stated)

Alternatively if you open both databases and place them side by side on your desktop, you MAY be able to drag the tables from one to the other (it isn't always possible)

Thanks Ridders for your reply....

But I was thinking, can't we do this pragmatically?

I meant the way we do it excel files like browse->select the excel file->Import
 

CJ_London

Super Moderator
Staff member
Local time
Today, 06:44
Joined
Feb 19, 2013
Messages
16,553
having linked, you would just have a query to append the data to a local table or whatever you are doing with it

import a specific table from a access file
you know the file name and location, you know the file name. So why do you need a browser? just use docmd.transferdatabase
 

sxschech

Registered User.
Local time
Yesterday, 23:44
Joined
Mar 2, 2010
Messages
791
If this is true:
you know the file name and location, you know the file name.

Then alternatively, this can be done with a query (No linking or importing involved) by using the IN statement.

Example:
Code:
SELECT *
FROM externalTable IN 'C:\TEMP\EXTFILE.ACCDB'

Could be more complicated query such as adding where clause or it could be an append query or a make table query into a local table.
 

jdraw

Super Moderator
Staff member
Local time
Today, 02:44
Joined
Jan 23, 2006
Messages
15,364
Rakesh935,

Are you doing this in Excel now and are trying to use Access?
I meant the way we do it excel files like browse->select the excel file->Import
Can you tell us a little about the process since you delete the records daily?
 

Cronk

Registered User.
Local time
Today, 17:44
Joined
Jul 4, 2013
Messages
2,770
To display a list of tables in an external Access database, set a database object to the that database and loop through the table names. Exclude system tables.


Code:
dim ws as workspace, db as database, tdf as tabledef
set ws = dbengine(0)
set db = ws.opendatabase("yourAccessDB.accdb")
for each tdf in db.tabledefs
   debug.print tdf.name
next
 

Users who are viewing this thread

Top Bottom