Import from or link to a SharePoint list

If your department or workgroup uses Windows SharePoint Services 2.0 or later to communicate and collaborate with each other, you might encounter scenarios where you need to work with some of the SharePoint lists in Microsoft Office Access 2007 to take advantage of its rich querying and reporting features.

If you are not familiar with Windows SharePoint Services and want to learn more, visit the Windows SharePoint Services Home page. Follow the link in the See Also section of this article.

You can bring a list into Office Access 2007 in either of two ways — by importing, or by linking. This article describes the steps both for importing from and for linking to a SharePoint list.

 Tip    Try Office 2010 In Access 2010, you can publish a database to a SharePoint server that is running Access Services, and then use the database in a browser! Read an article or try Office 2010.

What do you want to do?


Import a SharePoint list

Importing a SharePoint list creates a copy of the list in an Access database. During the import operation, you can specify the lists that you want to copy, and, for each selected list, you can specify whether you want to import the entire list or only a specific view.

The import operation creates a table in Access, and then copies the columns and items from the source list (or view) into that table as fields and records. Find links to more information about tables and how a database is structured in the See Also section.

At the end of the import operation, you can choose to save the details of the import operation as a specification. An import specification helps you to repeat the import operation in the future without having to step through the Import Wizard each time.

Common scenarios for importing a list into Access

Typically, you import a SharePoint list into an Access database for these reasons:

  • You want to permanently move a list, such as the Contacts list, to an Access database, because you no longer need the list on your SharePoint site. You can import the list into Access, and then delete the list from the SharePoint site.
  • Your department or workgroup uses Access, but you are occasionally pointed to a SharePoint list for additional data that must be merged into one of your databases.

The following steps explain how to import a SharePoint list into a database.

Prepare for the import operation

  1. Locate the SharePoint site that contains the lists that you want to copy, and make a note of the site address.

A valid site address starts with http:// followed by the name of the server, and ends with the path to the specific site on the server.

  1. Identify the lists that you want to copy to the database, and then decide whether you want the entire list or just a particular view. You can import multiple lists in a single import operation, but you can import only one view of each list. If necessary, create a view that contains just the columns and items in which you are interested.

 Note   You cannot import surveys or discussions.

  1. Review the columns in the source list or view. The following table explains some considerations to keep in mind when importing different elements.
Element Considerations
Columns Access does not support more than 256 fields in a table, so Access imports only the first 256 columns. To avoid this problem, create a view and add to it only the columns that you want, ensuring that the total number of columns doesn't exceed 256.
Folders Each folder in the SharePoint list or view appears as a record in the Access table. Items inside a folder also appear as records, immediately below the record corresponding to that folder.
Lookup columns

If a source column looks up values in another list, you have two choices:

  • Import the display values as part of the field itself. In this case, you do not need to import the related list.
  • Force the destination field to look up another table. In this case, if the database does not contain a table that can supply the lookup values, you must also import the related list.

 Note   A source column of type Person or Group is a special type of lookup column. It looks up values in the User Information list, so you must decide whether you want to import the User Information list along with other lists.

Calculated columns The results in a calculated column are copied to a field whose data type depends on the data type of the calculated result. The expression that performs the calculation is not copied.
Attachments The attachment column of the list is copied to a field named Attachments.
Relationships

Access does not automatically create relationships between related tables at the end of an import operation. You must manually create the relationships between the various new and existing tables by using the options on the Relationships tab. To display the Relationships tab:

On the Database Tools tab, in the Show/Hide group, click Relationships. Button image

Multivalued columns A column of type Choice or Lookup can contain multiple values. When you import a column that supports multiple values, Access creates a column that supports multiple values. To learn more about multivalued fields in Access, follow the links in the See Also section of this article.
Rich text formatting Columns containing rich text formatting are imported into Access as Memo fields. The Text Format property of the Memo Field is set to Rich Text, and the formatting is preserved.
  1. Identify the database into which you want to import the lists.

Ensure that you have the necessary permissions to add data to the database. If you don't want to store the data in any of your existing databases, create a blank database by clicking the Microsoft Office Button Button image, and then clicking New.

  1. Review the tables in the database.

The import operation creates a table with the same name as the SharePoint list. If that name is already in use, Access appends "1" to the new table name — for example, Contacts1. (If Contacts1 is also already in use, Access will create Contacts2, and so on.)

 Note   Access never overwrites a table in the database as part of an import operation, and you cannot append the contents of a list or view to an existing table.

Import the data

  1. Open the destination database.

On the External Data tab, in the Import group, click SharePoint List. Button image

  1. In the wizard, specify the address of the source site.
  2. Click Import the source data into a new table in the current database, and then click Next.
  3. From the list that the wizard displays, select the lists that you want to import.
  4. In the Items to Import column, select the view that you want for each selected list. Choose an All Elements view (for example, All Items, All Contacts, or All Documents) to import the entire list.
  5. The check box labeled Import display values instead of IDs for fields that look up values stored in another list controls which data is imported for lookup columns in the selected lists. Do one of the following:
    • If you want to import the display values as part of the field itself, select the check box. In this case, the field will not look up another table for values.
    • If you want the destination field to look up another table for values, clear the check box. Doing this will copy the IDs of the display value rows to the destination field. The IDs are necessary for defining a lookup field in Access.

When importing IDs, you must import the lists that currently supply the values to the lookup columns (unless the destination database already has tables that could act as lookup tables).

  1.  Note   It is important to remember that the import operation places the IDs in the corresponding field, but it does not set all of the properties necessary to make the field work like a lookup field. The steps for setting the lookup properties of such a field are described under Set lookup fields in the section Related tasks in this article.

  2. Click OK.

Access imports the lists, and then displays the status of the operation on the last page of the wizard. If you plan to repeat the import operation, save the details as an import specification. Go to the next steps to complete that task.

Save the import settings as a specification

  1. In the final screen of the wizard, select the Save Import Steps check box.

A set of additional controls appears.

  1. In the Save as box, type a name for the import specification. Optionally, type a description in the Description box.
  2. If you want to perform the operation at fixed intervals (such as weekly or monthly), select the Create Outlook Task check box. This creates a task in Microsoft Office Outlook 2007 that lets you run the specification.
  3. Click Save Import.

Configure the Outlook task

If you selected the Create Outlook Task check box in the previous procedure, Access starts Outlook and displays a new task. Follow these steps to configure the task.

 Note   If Outlook is not installed, Access displays an error message. If Outlook is not configured properly, the Outlook Configuration Wizard starts. Follow the instructions in the wizard to configure Outlook.

  1. In the Import-Name-Task window in Outlook, review and modify the task settings, such as Due date and Reminder.

To make the task recur, click Recurrence. This figure shows the task scheduler with some typical settings:

The Outlook task scheduler

For information about scheduling Outlook tasks, see the article Schedule an import or export operation.

  1. When you finish with the settings, click Save and Close.

Run a saved task

  1. In the Outlook Navigation Pane, click Tasks, and then double-click the task that you want to run.
  2. On the Task tab, in the Microsoft Office Access group, click Run Import Button image.
  3. Switch back to Access, and then open the imported table in Datasheet view. Ensure that all of the fields and records were imported, and that there are no errors. Switch to Design view to review the data type and other field properties.

Related tasks

After you have completed the import operation, consider performing some additional tasks:

Verify the data types    Access selects the appropriate data type for each field corresponding to a source column. To see a list of how Access and Windows SharePoint Services data types map to each other during importing or linking, and which field settings are imported for each data type, see How Windows SharePoint Services data types map to Access data types, later in this article.

Investigate additional fields    Depending on the type of list on which the table is based, you might also notice the presence in the table of a few extra fields (such as Edit, Modified, and Type). For more information about these fields and the information that they contain, see Windows SharePoint Services Help. If you don't need these fields in the Access database, you can safely delete them.

Set lookup fields    If you imported IDs for lookup columns, you must manually set the lookup properties of the corresponding fields.

  1. In Table Design view, in the field's Data Type list, click Lookup Wizard.
  2. In the wizard, accept the default selection (I want the lookup column to look up the values in a table or query), and then click Next.
  3. Select the table or query that will supply the lookup values for the field, and then click Next.

 Note   This table can be a newly imported table or an existing table.

  1. In the Field List pane, select the ID field and the field that contains the display values, and then click Next.
  2. Specify a sort order, and then click Next.
  3. Click Finish.

Top of Page Top of Page

Link to a SharePoint list

Linking lets you connect to data in another program without importing that information, so that you can view and edit the latest data both in the original program and your Access database without creating and maintaining a copy of the data in Access. If you don't want to copy a SharePoint list into your Access database, but instead want to run queries and generate reports based on the contents of that list, you should link rather than import.

When you link to a SharePoint list, Access creates a new table, often referred to as a linked table, that reflects the structure and contents of the source list. Unlike importing, linking creates a link only to the list, not to any specific views of the list.

Linking is more powerful than importing in two ways:

  • Adding and updating data    You can make changes to data either by browsing to the SharePoint site or by working in Datasheet or Form view within Access. The changes that you make in one place are reflected in the other.

However, if you want to make structural changes, such as removing or changing a column, you must do so by opening the list on the SharePoint site. You cannot add, delete, or modify the fields in a linked table while working in Access.

  • Lookup tables    When you link to a SharePoint list, Access automatically creates linked tables for all lookup lists (unless the lookup lists are already linked to the database). If the lookup lists contain columns that look up other lists, those lists are also included in the linking operation, so that the lookup list of every linked table has a corresponding linked table in the database. Access also creates relationships between these linked tables.

Common scenarios for linking to a SharePoint list

Typically, you link to a SharePoint list from an Access database for these reasons:

  • Your department or workgroup uses Access for rich reporting and querying, and uses Windows SharePoint Services for team collaboration and communication. Individual teams create lists to track various things (such as contacts and issues), but often this list data must be brought into a database for aggregation and reporting. Linking is the appropriate choice, because it allows users of both the SharePoint site and the database to add and update data, and to always view and work with the latest data.
  • You are an Access user who only recently started using Windows SharePoint Services. You migrated several of your databases to your team SharePoint site, and most of the tables in these databases are linked tables. From now on, instead of creating local tables, you will create SharePoint lists, and then link to these lists from your databases.
  • You want to continue storing your lists on SharePoint sites, but you also want to work with the most recent data inside of Access to run queries and print reports.

Prepare to link to a SharePoint list

  1. Locate the SharePoint site that has the lists to which you want to link, and make a note of the site address.

A valid site address starts with http:// followed by the name of the server, and ends with the path to the specific site on the server.

  1. Identify the lists to which you want to link. You can link to multiple lists in a single linking operation, but you cannot link to a specific view of any list.

 Note   You also cannot link to surveys or discussions.

  1. Review the columns in the source list. The following table explains some considerations to keep in mind when importing different elements.
Element Considerations
Columns Access does not support more than 256 fields in a table, so the linked table includes only the first 256 columns.
Folders Each folder in the SharePoint list appears as a record in the Access table. Items inside a folder also appear as records, immediately below the record corresponding to that folder.
Lookup columns

If a source column looks up values in another list and the related list isn't already in the database, Access automatically creates linked tables for the related lists.

 Note   A source column of type Person or Group is a special type of lookup column that looks up values in the User Information list. If you link to a list containing a Person or Group column, Access automatically creates a linked table for the User Information list.

Calculated columns The results in a calculated column are displayed in the corresponding field, but you are not able to view or modify the formula in Access.
Attachments The attachment column of the list is displayed as a field named Attachments.
Read-only columns The columns that are read-only in a SharePoint list will continue to be read-only in Access. In addition, you might not be able to add, delete, or modify columns in Access.
Multivalued columns A column of type Choice or Lookup can contain multiple values. For such columns, the linking operation creates fields that support multiple values. Multivalued lookup columns are created in the linked table if the source column is of type Lookup.
  1. Identify the database in which you want to create the linked tables. Ensure that you have the necessary permissions to add data to the database. If you don't want to store the data in any of your existing databases, create a new, blank database.

Click the Microsoft Office Button Button image, and then click New.

  1. Review the tables in the database. When you import a SharePoint list, a table having the same name as the source list will be created. If that name is already in use, Access will append "1" to the new table name — for example, Contacts1. (If Contacts1 is also already in use, Access will create Contacts2, and so on.) The same rules apply for related lists.

 Note   As you proceed, remember that Access never overwrites a table in the database as part of an import operation. Also, you cannot append the contents of a SharePoint list to an existing table.

Link to the data

  1. Open the destination database.

On the External Data tab, in the Import group, click SharePoint List. Button image

  1. In the wizard, specify the address of the source site.
  2. Click Link to the data source by creating a linked table, and then click Next.

The wizard displays the lists that are available for linking.

  1. Select the lists that you want to link to, and then click OK.

 Note   If some lists are already linked to the current database, the check boxes corresponding to those lists will be selected. If you want to remove any links at this time, clear the check boxes of the links you want to remove. Otherwise, leave the check boxes selected to preserve the links.

Access attempts to create linked tables, both for the lists that you selected during this operation and for each of the related lists. Also, Access attempts to refresh the linked tables corresponding to the lists that were selected in the wizard. Access also creates the relationships between the tables.

 Note   Unlike an import operation, a linking operation maintains the lookup property settings between a lookup field and the related table. You need not manually set the properties of the lookup field in table Design view.

  1. Review the new linked tables in Datasheet view. Ensure that all of the fields and records are displayed correctly.

 Note   Access selects the right data type for each field that corresponds to a source column. To see a list of how Access and Windows SharePoint Services data types map to each other, see the section How Windows SharePoint Services data types map to Access data types in this article.

It is important to note that each time you open either a linked table or the source list, you see the latest data displayed in it. However, structural changes made to a list are not automatically reflected in a linked table. To update a linked table by applying the latest list structure, right-click the table in the Navigation Pane, point to SharePoint List Options, and then click Refresh List Button image.

How Windows SharePoint Services data types map to Access data types

The following table lists how Access decides the data types of the fields in the imported table when you import or link to a SharePoint list.

Windows SharePoint Services data type Access data type Important property settings Notes
ID AutoNumber

Field Size    Long Integer

New Values    Increment

Indexed    Yes (No Duplicates)

Read-only.
Single line of text Text

Field Size    255

Default Value    Mirrors the Default Value setting in Windows SharePoint Services.

Validation Rule     Mirrors the values set for the Min and Max properties in Windows SharePoint Services.

Multiple lines of text Memo

Required    Mirrors the Required setting in Windows SharePoint Services.

Default Value    Mirrors the Default Value setting in Windows SharePoint Services.

Access can display up to 64 KB of data in a text box. If the field contains more than 64 KB of text, the displayed results are truncated.

The Number of lines to display property is ignored.

Number Number

Field Size    Double

Decimal Places    Mirrors the Number of decimal places setting in Windows SharePoint Services.

Default Value    Mirrors the Default Value setting in Windows SharePoint Services.

Required    Mirrors the Required setting in Windows SharePoint Services.

Validation Rule     Mirrors the values set for the Min and Max properties in Windows SharePoint Services.

Currency Currency

Default Value    Mirrors the Default Value setting in Windows SharePoint Services.

Decimal Places    Mirrors the Number of decimal places setting in Windows SharePoint Services.

Validation Rule    Mirrors the values set for the Min and Max properties in Windows SharePoint Services.

Format    Mirrors the Currency format setting in Windows SharePoint Services.

Required    Mirrors the Required setting in Windows SharePoint Services.

Date or Time Date/Time

Required    Mirrors the Required setting in Windows SharePoint Services.

The Format property is set to Short Date if the Date and Time format is set to Date Only in Windows SharePoint Services. Otherwise, the Format property is blank.

Lookup and Person or Group Number or Memo

Field Size    Long Integer (if data type is Number)

The following properties are set only when linking to a list:

Display Control    Combo Box

Required    No

Row Source Type    Table/Query

Row Source    SELECT ID, <Lookup Field> FROM <Lookup Table> Order By <Lookup Field>;

Bound Column    1

Column Count    2

Column Heads    No

Column Widths    0

List Rows    8

List Width    Auto

Limit To List    Yes

When you import, the data type depends on whether you are retrieving IDs or display values. When you link, the data type of these columns is set to Number.
Choice (single) Text

Field Size    255

Default Value    Mirrors the Default Value setting in Windows SharePoint Services.

Display Control    Combo Box

Row Source Type    Value List

Row Source    ="<choice 1>";"<choice 2>";..."<choice n>"

Choice (multiple) Text

Display Control    Text Box

Default Value    Mirrors the Default Value setting in Windows SharePoint Services.

Required    Mirrors the Required setting in Windows SharePoint Services.

Allow multiple values    Yes

The Choices, Display choices using, and Allow Fill-in choices settings in Windows SharePoint Services are ignored.
Yes/No Yes/No

Display Control    Check Box

Default Value    Mirrors the Default Value setting in Windows SharePoint Services.

Hyperlink Hyperlink Required    Mirrors the Required setting in Windows SharePoint Services. The Format URL as SharePoint setting is ignored.
Attachment Attachment
Calculated Depends on the data type of the resulting value

The formula is ignored.

Read-only in a linked table.

Rich Text Memo

Display Control    Text Box

Required    Mirrors the Required setting in Windows SharePoint Services.

Text Format    Rich Text

Access can display up to 64 KB of data in a text box. The displayed results are truncated if the field contains more than 64 KB of text.

The Number of lines to display setting in Windows SharePoint Services is ignored.

Enhanced Rich Text Memo

Display Control    Text Box

Required    Mirrors the Required setting in Windows SharePoint Services.

Text Format    Rich Text

Read-only.

Access can display up to 64 KB of data in a text box. The displayed results are truncated if the field contains more than 64 KB of text.

The Number of lines to display setting in Windows SharePoint Services is ignored.

Top of Page Top of Page

 
 
Applies to:
Access 2007