Public Health Emergency Preparedness
This resource was part of AHRQ's Public Health Emergency Preparedness program, which was discontinued on June 30, 2011, in a realignment of Federal efforts.
This information is for reference purposes only. It was current when produced and may now be outdated. Archive material is no longer maintained, and some links may not work. Persons with disabilities having difficulty accessing this information should contact us at: https://info.ahrq.gov. Let us know the nature of the problem, the Web address of what you want, and your contact information.
Please go to www.ahrq.gov for current information.
2.3.2. Downloading and Importing Data into MS Access
As described in the previous section, the large
volume of data will not import into one Access file from one .csv data file.
For that reason, as with MS Excel, the data is divided into two .csv files. To
use MS Access for data analysis, simply select "Download Data Part 1," and
save the .csv file to your hard drive. This file will contain data for the
unique ID number, all the demographic questions, and questionnaire questions 1
through 20. Next, select "Download Data Part 2," and save this .csv file to your
hard drive. This file will contain data including the unique ID number and
questions 21 through 43.
These
.csv data files can be easily be imported into MS Access for analysis by using
the MS Access Wizard function. The following sections provide instructions for
importing the .csv data from these .csv data files.
Getting Ready. The .csv data files downloaded above and saved to your
hard disk must be altered slightly before importing into MS Access for analysis.
Before importing these data files, open each file in Notepad and remove all
quotes surrounding the data. This can be done by selecting "Edit" and "Replace"
from the menu. Search for a quote in the "Find What" text box, and "Replace
With" nothing, as seen below. Select the "Replace All" button. Then, resave the
files without the quotes and close the file.

Next, open
the MS Access program. Select "File" and then "New." The program will
then prompt you to specify the type of new database you would like to create.
Choose "Blank Database," and name and save this new database as desired using
the standard Windows dialog prompt.
Starting
the Wizard. In order to start the importing wizard, select "File," then "Get
External Data," and finally "Import" from the menu. The standard Windows open
dialog window will prompt you for the file to import.
You
should first narrow down your file selection view by choosing "Text Files" from
the "Files of Type:" field at the bottom of the screen. This will narrow down
your search to show you the appropriate data files in each directory. When you
find the first data file to import, select it and click the "Import" button.

When
you click the "Import" button, you will begin the Wizard.
Import
Text Wizard—Step 1. Once the Import Text Wizard has started, you will see
the following window. Make sure the "Delimited" box is selected and click the "Next"
button.

Import Text Wizard—Step 2. Then, you will be
prompted to define the file format in the following window. Make sure that "Comma"
is selected as the delimiter that separates your fields, the "First Row
Contains Field Names" is selected (or contains a check mark), and the "Text
Qualifier" is set to {none}.
At this point, you should take a preliminary look at
the data fields shown. If the data contains faulty characters, is not lining up
appropriately, or is otherwise showing poorly, your data file may have been
corrupted. If you suspect that your data file may be corrupted, resave the .csv
file from the application to your hard drive by repeating the data download
steps above. If the data looks appropriate, then click the "Next" button.

Import
Text Wizard—Step 3. The Wizard will
now prompt you to specify a table into which the text file data should be
imported within this database. Select "In a New Table" which will allow MS Access
to create a new table within the database with the imported data. Select the "Next"
button.

Import
Text Wizard—Step 4. Next, the data
must be formatted for file importing. Note in the window below that the data
columns are selectable. Select the "BeginTime" column, and set the "DataType:"
to "Text." Do the same for the "EndTime" column. These columns default to the date/time
data format, but MS Access will not import these dates appropriately. By
selecting text, the fields will be imported without errors. Select the "Next"
button.

Import
Text Wizard—Step 5. MS Access can
add a primary key to your data upon insert. This is not necessary at this point
and can also be added in later, after the data has been imported. At this time,
select "No primary key." Select the "Next" button.

Import
Text Wizard—Step 6. At this time, MS
Access will prompt you for a table name. Type in the desired table name, and
click the "Finish" button. You should receive a prompt stating that the Wizard
has finished importing the file to the indicated table. If you receive an error
at this point, MS Access will create an error table and list the importing
errors in that location.

Importing
the Second Data File. Repeat all of the
above steps to import the second data file into MS Access using the Import Text
Wizard. The second data file does not contain a BeginTime or EndTime data
field, so you do not need to alter any column types within step 4.
Viewing
your Table. You will see the newly
created table within the "Table" tab of the Access database display window
below. To view the data, double select the desired table.

Once you have double clicked on the Access table, you will see the following view of
the table and its data. Simply use the scroll bars to view the data in its
entirety.

There
are several ways to alter the table's view to better view the data. MS Access
will open the table with the default column width shown above. In order to
alter the column width, simply place the mouse in the title row, highlighted in
gray, over the column line to be moved. When the mouse changes to a cross hair,
you can then hold the left mouse button down and adjust the column width.
Since
there are too many columns to show in one view, you can highlight columns to
"freeze" or continue to show as the scroll bar is used to move through the
data. To do this, simply highlight the column to freeze by clicking on its name
in the title bar, as shown below. Then, right click to show the menu options,
and select "Freeze Columns." You will notice that a dark black line will be
drawn to the right of this column to show that it is frozen. To unfreeze the
column, simply right select the title bar again and select "Unfreeze All
Columns," also shown below.

If
you freeze the SurveyID column, as shown above, then you can see how the
SurveyID will remain visible as you scroll through the data, as seen below.

Return to Contents
Proceed to Next Section