There are many reasons for importing and exporting data and database objects. Most of them amount to trying to save time and effort! In addition, copying data removes the chance of introducing new data-entry errors when re-entering data.
Linking to data means you don't copy it at all. There is one source for the data. Multiple databases or other programs can use it. Everyone sees the most up-to-date values. (In earlier versions of Access this feature was called attaching.)
Importing
into an Access database from another Access database is best, of course!
You have the most choices of what to import.
What is next best?? It's hard to choose! There are buttons on the ribbon to import from Excel, Access, ODBC, Text, and XML. Apparently Access expects to do more importing with these formats. The More button drops a list of other formats: SharePoint List, Data Services, HTML, Outlook and (for Access 2007 and 2010) dBase.
Access has wizards to help you with importing files in the formats that it recognizes.
If the data you want to use is not in one of the formats that Access understands, you will need to export it from the original program into one of those formats. Excel and text file formats are usually available in various programs in their Save As and Export As dialogs. XML is a newer format that may not be an export option in older programs. You will use data from an XML file later in these lessons.
Excel formats are excellent if your data was in a spreadsheet or some kind of flat file database. Formulas do not get imported, just the current values.
About dBase: The program dBase was a successful early database program. Many programs have used this format over the years and many more can save their tables in one of several dbf formats. Importing such a file will bring the indexes along with the tables. But Office 2013 and 2016 programs will not import or export files in dbf formats.
Ribbon tab: External Data > Click the button for the data type > Navigate to the file
Pick a home
for your data: Importing and exporting the same table back and forth
between programs can cause serious problems with the data. Decide where the
data is going to live and stick to it!
What program will be importing your data? A format that matches that program would be best. For example, if the data will be opened in Excel, export in that an Excel format. If you don't know which version of Excel will be used, choose the earliest version and try it out with a much later version to see if you lose anything important.
If you don't know what program will be using the data, then a text format like CSV might be the safest format. One of the dBase formats used to be a fairly good choice since many programs can import files in those formats. But Microsoft dropped support for importing and exporting in dBase formats with Office 2013.
Be sure you export the field names along with the records!
Many issues can cause an import into Access or a link to fail. Some are not obvious when looking at the data. For example, are those numbers being treated as numbers or as text?
Truncated data: If an Excel spreadsheet has a cell with more than 255 characters and is linked to an Access database, Access considers the field to be a Memo or Long Text data type but shows only the first 255 characters. You can create a table first with the field size set large enough to hold all the characters and then append the spreadsheet data.
Warning: The Import Spreadsheet Wizard looks at the first 25 rows to decide how large
fields should be. If later the contents of rows are larger, the data will
be cut short (i.e. truncated).
We won't try to import/export/link with every format that Access can manage! In the next lesson you will use the most commonly used file formats to get the tables you need to do the lessons in the next project, Forms and Reports.