Professional Documents
Culture Documents
This guide show s how to either link or import MS Access database s to MS SQL Server.
Exercise s 1-4 cover the development of a Database Project which has a front -end MS
Acce ss user interface with the tables held under a back-end MS SQL Server.
The guide can be used to transfer new or existing MS Acce ss databa se s to MS SQL
Server. i.e. the transfer of table s and data to a central server.
Completing thi s guide you will be able to generate client server based database s.
The workstations run MS Acce ss front end facilities to acce ss the data and provide
information.
The server runs MS SQL Server to hold and maintain a central bank of data.
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7: 1
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7: 2
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
c. Click on the will load up the appropraiate servers to choose from. The following Data
Connection Form typically will display the home PC name.
d. Select finish
e. Having created a new MS Access Project called library we may create the tables as you
normally do in MS Access. However remember the tables and dat a will be held under
MS SQL Server.
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7: 3
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7: 4
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
LIBRARY DATABASE
MS Acce ss 2000 MS Acce ss 2000 Zip
Library.mdb
h. Select All tables. (Also select required forms, reports, etc). Note you cannot trans fer MS
Access Queries over to MS SQL Server. These queries need to reflect the new location
of tables and data. Simply generated new queries.
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7: 5
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
i. Click OK to import tables and data. You may interrogate and maintain the library
database as before.
However you can also interrogate the data under MS SQL Server.
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7: 6
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
Inserting Data
Exercise 4 Inserting data to a connected MS SQL / MS Access Project
Data can be inserted into the librarySQL database in either platform. Please not e data is held
under MS SQL environment.
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7: 7
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
Give it a name and configure the other settings as needed and click OK. Now we
need to right-click on the database we just created and choose Tasks and then
Import Data.
On the Data Source dialog box, scroll up until you see Microsoft Access.
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7: 8
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
Next to File, click on Browse and navigate to the Access database you want to
import and click Open. Note that the database cannot be in Access 2007 format
as SQL Server 2008 does not recognize it! So if you have a 2007 Access
database, first convert it to the 2002-2003 Access format by going to Save As.
Go ahead and click Next to choose the destination. Since you right-clicked on the
database you wanted to import the data into, it should already be picked in the
list.
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7: 9
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
Click Next and then specify how you want to transfer the data from Access to
SQL by choosing either Copy the data from one or more tables or Write a
query to specify the data to transfer.
In most cases, if you want to just transfer the entire database, you should choose
the first option. If you want only a portion of the data from a particular table, you
can write out the SQL query. Click Next.
By default all the tables should be selected and if you click the Edit button under
Mapping, youll see the the destination database will create all of the tables to
match whats in the Access database.
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7:10
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
Here I have only one table in my Access database. Click Next and then choose
whether to execute immediately or to save it as a file to perform later.
Click Next and then click Finish. Youll then see the progress of the data transfer
as it occurs.
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7:11
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
After it is completed, youll see the number of rows transferred for each table in
the Message column.
Click Close and you should now have all of your Access data nicely imported into
a SQL Server 2008 database, which you can then use for whatever you like.
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7:12
Chapter 7: MS SQL SERVER 2008 SQLQuery MS Access linking to MS SQL Server
Mansha Nawaz MS SQL SERVER 2000 QA MS Access linking to MS SQL Server Chapter 7:13