Creating Tables   «Prev  Next»
Lesson 7 Importing data from another database
Objective Import a table from another database.

Importing Data From Another Database

If you or someone in your office has been using Access, it is possible that the data you need is already in an Access database. It is a simple task to import a table with data from another Access database. The following link shows you how.
Import Invoices Table
When To Avoid Data importing
Listen to when importing data is not a good idea.

Importing from SharePoint Using VBA Code

Aside from being able to import data into Access from the SharePoint entry point, a developer can also import a SharePoint list programmatically using VBA code from within Access. The TransferSharePointList method allows a developer to either import or link to a SharePoint list programmatically. TransferSharePointList is a method of the DoCmd class, which is a member of the Application object. TransferSharePointList takes up to six arguments, three of which are required. The following table describes each of these arguments.

PARAMETER DESCRIPTION
TransferType Requires a member of the enumeration type AcSharePointListTransferType. Two options are available: 1) acImportSharePointList and 2) acLinkSharePointList.
SiteAddress The full URL path to the SharePoint site. This parameter is required.
ListID The Name or the GUID of the list to be transferred. This parameter is required.
ViewID The GUID of the view that should be imported. This means that imported data can be pre-filtered by a specific list view on SharePoint before pulling the data into Access. This parameter is optional and not available for when the acImportSharePointList option is chosen for the transfer type. If not specified, all the fields on the SharePoint site will be retrieved.
TableName The name of the new linked table in the database. This parameter is optional and not available for when the acImportSharePointList option is chosen for the transfer type. If not specified, the name of the SharePoint list will be used for the new table in the database.
GetLookupDisplayValues When False, any lookup fields will contain the IDs to the list to which the lookup is tied. When True, the actual display values will be imported. This parameter is optional and not available for when the acImportSharePointList option is chosen for the TransferType.

Importing Data From Another Database - Exercise

In this exercise, import a table from another database.
Importing Data From Another Database - Exercise