Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

26
Microsoft Office Access 2007 – Microsoft Office Access 2007 – Illustrated Illustrated Importing and Exporting Importing and Exporting Data Data

Transcript of Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Page 1: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Microsoft Office Access 2007 –Microsoft Office Access 2007 –Illustrated Illustrated

Importing and Exporting DataImporting and Exporting Data

Page 2: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

ObjectivesObjectives

• Use database templatesUse database templates

• Use table templatesUse table templates

• Import data from ExcelImport data from Excel

• Link dataLink data

(continued)(continued)

Microsoft Office Access 2007 - Illustrated 2

Page 3: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Objectives Objectives (continued)(continued)

• Export data to ExcelExport data to Excel

• Analyze data with ExcelAnalyze data with Excel

• Publish data to WordPublish data to Word

• Merge data with WordMerge data with Word

Microsoft Office Access 2007 - Illustrated 3

Page 4: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Using Database TemplatesUsing Database Templates

Microsoft Office Access 2007 - Illustrated 4

• Database templateDatabase template: A tool used to : A tool used to create a database based on a create a database based on a particular subject (assets, contacts, particular subject (assets, contacts, events, projects)events, projects)

• Local templateLocal template: Stored on the hard : Stored on the hard drivedrive

• Online templateOnline template: Downloaded from : Downloaded from the MS Office Web sitethe MS Office Web site

Page 5: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Database ObjectsDatabase Objects

• GroupGroup: A category that organizes the : A category that organizes the objects that belong to that categoryobjects that belong to that category

• ShortcutShortcut: Points to the object; a small : Points to the object; a small black arrow in the lower left cornerblack arrow in the lower left corner

Microsoft Office Access 2007 - Illustrated 5

Page 6: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Using Table TemplatesUsing Table Templates

Microsoft Office Access 2007 - Illustrated 6

• Table templateTable template: Used to create a table : Used to create a table within an existing database; provides within an existing database; provides a set of fields describing a subject a set of fields describing a subject (contacts, tasks)(contacts, tasks)

• You need to designate the You need to designate the primary primary key field / foreign key fieldskey field / foreign key fields (create a (create a relationship with other tables)relationship with other tables)

• Apply Apply referential integrityreferential integrity when when possiblepossible

Page 7: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Creating RelationshipsCreating Relationships

Microsoft Office Access 2007 - Illustrated 7

One-to-many link between Students

and Courses

Page 8: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Referential Integrity OptionsReferential Integrity Options

Microsoft Office Access 2007 - Illustrated 8

• Cascade Update Related FieldsCascade Update Related Fields: If : If the primary key field’s value is the primary key field’s value is updatedupdated, then all values in the foreign , then all values in the foreign key field are automatically updated key field are automatically updated (one-to-many relationship)(one-to-many relationship)

• Use it carefully!Use it carefully!

Page 9: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Referential Integrity OptionsReferential Integrity Options

Microsoft Office Access 2007 - Illustrated 9

• Cascade Delete Related RecordsCascade Delete Related Records: If : If the primary key field’s value is the primary key field’s value is deleteddeleted, all related records in the , all related records in the foreign key field are automatically foreign key field are automatically deleted (one-to-many relationship)deleted (one-to-many relationship)

• Use it carefully!Use it carefully!

Page 10: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Microsoft Office SuiteMicrosoft Office Suite

Microsoft Office Access 2007 - Illustrated 10

The 4 most commonly used programsThe 4 most commonly used programs

contained in MS Office:contained in MS Office:

• AccessAccess

• ExcelExcel

• PowerPointPowerPoint

• WordWord

Others include Project, OneNote, Outlook, PublisherOthers include Project, OneNote, Outlook, Publisher

Page 11: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Importing Data from ExcelImporting Data from Excel

Microsoft Office Access 2007 - Illustrated 11

• ExcelExcel: The spreadsheet program in : The spreadsheet program in MS OfficeMS Office

• ImportingImporting: Converting data from an : Converting data from an external file into an Access databaseexternal file into an Access database

• Delimited or CSV fileDelimited or CSV file: Stores 1 record : Stores 1 record on each line with field values on each line with field values separated by a comma, tab, or dashseparated by a comma, tab, or dash

• XML fileXML file: Contains Extensible Markup : Contains Extensible Markup Language tags to identify fields/dataLanguage tags to identify fields/data

Page 12: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Relationships WindowRelationships Window

Microsoft Office Access 2007 - Illustrated 12

One-to-many relationship between the Courses and Materials tables with referential integrity enforced

Page 13: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Linking DataLinking Data

Microsoft Office Access 2007 - Illustrated 13

• LinkingLinking: Connects an Access : Connects an Access database to data in an external filedatabase to data in an external file

• ODBCODBC: Open Database Connectivity: Open Database Connectivity

Page 14: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Linking vs. Importing DataLinking vs. Importing Data

LinkingLinking

• Data not copied into Data not copied into the databasethe database

• Data stored in original Data stored in original file onlyfile only

• Changes made to one Changes made to one file are automatically file are automatically made to the othermade to the other

ImportingImporting

• Data is copied into the Data is copied into the databasedatabase

• Duplicate copy of data Duplicate copy of data as a new tableas a new table

• Changes to the Changes to the original data source original data source OR the imported OR the imported Access copy have no Access copy have no effect on the othereffect on the other

14Microsoft Office Access 2007 - Illustrated

Page 15: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Getting External DataGetting External Data

15Microsoft Office Access 2007 - Illustrated

Excel Spreadsheet Dialog Box:Excel Spreadsheet Dialog Box:

Page 16: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Exporting Data to ExcelExporting Data to Excel

Microsoft Office Access 2007 - Illustrated 16

• ExportingExporting: Copies Access information : Copies Access information to another database, spreadsheet, or to another database, spreadsheet, or file formatfile format

• ExportingExporting is the opposite of importing is the opposite of importing

• It is very common to export Access It is very common to export Access data to data to ExcelExcel

Page 17: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Analyzing Data with ExcelAnalyzing Data with Excel

Microsoft Office Access 2007 - Illustrated 17

Why analyze Access data using Excel?Why analyze Access data using Excel?• Excel can graph numeric trendsExcel can graph numeric trends• What-if analysisWhat-if analysis: Analyzes the impact : Analyzes the impact

of revising figures in a financial of revising figures in a financial analysis; you can change numeric analysis; you can change numeric values and watch the related values and watch the related calculations update instantlycalculations update instantly

• Excel can quickly display numeric Excel can quickly display numeric information as a chartinformation as a chart

Page 18: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Analyzing Data with ExcelAnalyzing Data with Excel

Microsoft Office Access 2007 - Illustrated 18

Access Cost Data Presented as a Column Chart in Excel:Access Cost Data Presented as a Column Chart in Excel:

Clustered column chart

Page 19: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Publishing Data to WordPublishing Data to Word

Microsoft Office Access 2007 - Illustrated 19

Why publish Access data using Word?Why publish Access data using Word?

• Word is superior for entering, editing, Word is superior for entering, editing, and formatting text, especially in a and formatting text, especially in a long documentlong document

• Explanatory text can be easily added Explanatory text can be easily added to Access datato Access data

• Access data can be easily inserted Access data can be easily inserted into an existing Word documentinto an existing Word document

Page 20: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

More on Word and AccessMore on Word and Access

Microsoft Office Access 2007 - Illustrated 20

• Access data appears in Word as an Access data appears in Word as an RTFRTF (rich text format) document (rich text format) document

• RTF format allows easy editingRTF format allows easy editing

• Word wrapWord wrap: A feature in Word that, : A feature in Word that, as you type a line of text and reach as you type a line of text and reach the right margin, automatically forces the right margin, automatically forces text to the next line without having to text to the next line without having to press [Enter]press [Enter]

Page 21: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Word Document with Word Document with Exported Data from AccessExported Data from Access

Microsoft Office Access 2007 - Illustrated 21

Page 22: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Copying Access Data to Copying Access Data to Other ApplicationsOther Applications

Microsoft Office Access 2007 - Illustrated 22

Page 23: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Merging Data with WordMerging Data with Word

Microsoft Office Access 2007 - Illustrated 23

• Use Access data as the data Use Access data as the data sourcesource in a Word in a Word mail mergemail merge

• Mail mergeMail merge: A Word form letter, label, : A Word form letter, label, or envelope to create a mass mailingor envelope to create a mass mailing

Page 24: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

Merging Data with WordMerging Data with Word

Microsoft Office Access 2007 - Illustrated 24

• Main documentMain document: The document that : The document that determines how the letter and Access determines how the letter and Access data are combineddata are combined

• Merge fieldsMerge fields: Codes in the main : Codes in the main document that are replaced with the document that are replaced with the Access data Access data

Examples: <<FirstName>>Examples: <<FirstName>>

<<LastName>><<LastName>> <<Address>><<Address>>

Page 25: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

SummarySummary

• Use database and table templates Use database and table templates provided by Access to quickly and provided by Access to quickly and easilyeasily

• Microsoft provides many tools to Microsoft provides many tools to share data between Office programsshare data between Office programs

• You can analyze, publish, and merge You can analyze, publish, and merge datadata

Microsoft Office Access 2007 - Illustrated 25

Page 26: Microsoft Office Access 2007 – Illustrated Importing and Exporting Data.

SummarySummary

• Data can be shared via importing, Data can be shared via importing, exporting, and linkingexporting, and linking

• Access data can be imported from Access data can be imported from and exported to many different file and exported to many different file formatsformats

Microsoft Office Access 2007 - Illustrated 26