Importing the Northwind Access Database into SQL Server

Description

A step-by-step tutorial for importing the Northwind Access Database into SQL Server.

Discussion

The Northwind database is a Microsoft Access database that ships with Alpha Anywhere. In order to perform CRUD (Create, Read, Update, Delete) operations on the Northwind Access database, the database must be copied to a directory where you have read/write access or converted to another database format. The Northwind Access database can be found inside the MDBFiles directory in your Alpha Anywhere installation. Your Alpha Anywhere install is typically located at C:\Program Files (x86)\a5v12. In this tutorial, you will learn how to convert the Northwind Access database to a SQL Server database.

This tutorial requires SQL Server or SQL Server Express and SQL Server Management Studio are installed on your system.
  1. Open SQL Server Management Studio. Right-click on "Databases" and select New Database... from the context menu.

    images/northwindSQLServer1.png
    Create a New Database...
  2. In the Database name field, type in "northwind" and click OK

    images/northwindSQLServer2.png
  3. Right-click on the northwind database in the Object Explorer and select Tasks then Import Data....

    images/northwindSQLServer3.png
  4. Click Next to start the SQL Server Import and Export Wizard.

    images/northwindSQLServer4.png
  5. On Choose a Data Source, select Microsoft Access from the dropdown menu. If you have multiple Microsoft Access options, choose "Microsoft Access (Microsoft Access Database Engine)", if available.

    images/northwindSQLServer5.png
  6. Click Browse for File name: and navigate to the MDBFiles directory in the installation directory for Alpha Anywhere. Alpha Anywhere is typically installed in the C:\Program Files (x86)\a5v12 directory. Select the Northwind.mdb file and click Open.

    images/northwindSQLServer6.png
  7. Click Next > to proceed to the next step.

    images/northwindSQLServer7.png
  8. On the Choose a Destination page, select SQL Server Native Client 11.0 for Destination and northwind for Database. Click Next >.

    images/northwindSQLServer8.png
  9. On Specify Table Copy or Query, select Copy data from one or more tables or views and click Next >.

    images/northwindSQLServer9.png
  10. On Select Source Tables and Views, select all of the tables and views. Click Next >.

    images/northwindSQLServer10.png
  11. Click Next > until you reach the Complete the Wizard tab. Click Finish.

    images/northwindSQLServer12.png
  12. When execution completes, click the Close button.

    images/northwindSQLServer13.png
  13. You should see a list of tables in the northwind database. The Northwind database is now imported into SQL Server.

    images/northwindSQLServer14.png

Build a SQL Server Connection String 

Now that the Northwind database has been imported into SQL Server, the next step is to create a Connection String to the database.

  1. From the Web Projects Control Panel, select [ManageConnStr] Manage Connection Strings > Alpha DAO Connection strings from the Edit menu to create a new connection string.

    images/connectionstring1.png
    Open the AlphaDAO Connections dialog.
  2. Click the New button to create a new connection string.

    images/connectionstring2.png
    The AlphaDAO Connections Dialog.
  3. Type in "Northwind" for the Connection Name and click the Build button to construct the Connection String.

    images/connectionstring3.png
    Creating a new connection to the Northwind SQL Server database.
  4. Select SQLServer from the list of options in the Select an API window and click OK.

    images/connectionstringSQLServer1.png
    Set the Connection Type to SQLServer.
  5. Enter the Version, Server name, Port, and Credentials information for your SQL Server instance.

    Server names should be in the form server\instanceName. If you omit the instance name, the default instance is assumed.

    You can click the How do I format server names for SQL Server instances? link to open the help popup (shown below) to find more information on the server name.

    images/connectionstringSQLServer7.png
    Configuration options for SQL Server.
    images/connectionstringSQLServer6.png
    Help popup for "How do I format server names for SQL Server instances?"
  6. Test the connection by clicking the Test Connection button. You should see a success message. If you receive an error message, verify the Version, Server, Port and Credentials are correct.

    images/connectionstringSQLServer3.png
    Success! The SQL Server connection works.
  7. Click the Refresh button to populate the Database dropdown box. Select the Northwind SQL Server database you created from the list of options. Click OK to create the SQL Server connection string.

    images/connectionstringSQLServer2.png
    Configuring SQL Server connection string. This is image shows a configuration for connecting to a SQL Server Express instance. The Northwind database in this SQL Server instance is named "northwind".
  8. Click OK to save the new Northwind connection string.

    images/connectionstringSQLServer4.png
    Click OK to save the Northwind connection string.
  9. Click the Close button to exit the AlphaDAO Connections dialog. You can now build a mobile or web application that communicates with the Northwind SQL Server database. Click here for a list of tutorials that use the Northwind database.

    images/connectionstringSQLServer5.png
    The Northwind AlphaDAO connection string for SQL Server.

See Also