GO Software Pty Limited Map: 27 Tacoma Blvd, Pasadena SA 5042 Phn: 0403-063-991 Fax: none ABN: 54-008-044-906 ACN: 008-044-906 Eml: support@gosoftware.com.au Web: www.gosoftware.com.au Moving a database from MS Access to MS SQL server Introduction Moving a database from MS Access to MS SQL Server is achieved using the Upsizing Wizard in Access: this assumes that you already have an empty database set up on the MS SQL Server. Your Access database will be upsized into this existing database. From reading this it looks like you can move {database}.mdb to {database} in SQL server and then create a {database}.adp which can then be opened in access as if it were an access database except that you are actually accessing the data in the SQL server database. You can edit an ADP file that has all of the form information turned off by finding the file using Windows Explorer, highlighting the file, then hold shift, and then press enter and continue to hold shift until the interface is loaded. NB: Before you upsize ensure that the tables within your existing database start with an alphabetic character, e.g. data_2003 rather than 2003. You cannot successfully upsize a database containing tables which are named using numeric characters only. If your database is currently held within your web you will need to export it to your local drive before upsizing. Do this as follows: 1. Open up the web containing your database 2. Click on [View] and then on [Folder List] 3. Navigate to and select the database (normally within the fpdb directory) 4. Click on [File] then [Export...]. By default your My Documents folder will open but you can navigate to a different location if you wish. You can also choose to rename the database at this point. 5. Once you are happy click on [Save] and your database will be exported to the chosen location. Selecting the database Instructions for upsizing are as follows:- 1. In Access open the database you wish to upsize. 2. Select Tools - Database Utilities - Upsizing Wizard. 3. Select Use existing database. Click on [Next]. If you have previously created a local (ie on your personal machine) data source connection to your SQL server database, go straight to Selecting a Data Source. Creating a Data Source 1. Click on [New] to create new data source.
2. Select SQL Server from the list of drivers. 3. Enter a name for the connection. Click on [Next]. 4. Check details are correct and click on [Finish].
5. Enter a description and the server to connect to and click on [Next]. 6. Check that Windows NT authentication is selected and click on [Next]. 7. The default database is already selected.
8. If this is not the correct database select Change the default database to and choose the correct database from the dropdown list. 9. Click on [Next] and then on [Finish]. 10. A setup screen will appear confirming the settings chosen. 11. Click on [Test Data Source...] to check connection. 12. A screen should appear confirming that the tests have been successful
13. Click on [OK] and [OK] again. Selecting a Data Source 1. Select the DSN from the list and click on [OK]. 2. Select the tables to be exported and click on [Next]. 3. Amend the following screen to export table attributes required and click on [Next].
Creating an Access Data Project (ADP) 1. On the next screen select Create a new Access client/server application. 2. A new Access Data Project (adp) file is now ready to be created. By default, Access will create the project file in the My Documents Folder on your local computer: if you wish to save the file elsewhere click on the [Browse] button and navigate to the appropriate directory. We suggest that you keep this file on a network drive to ensure that it is regularly backed up. If the appropriate directory is selected the next window allows the user to either open the new ADP file or keep the MDB file open 3. Click on [Finish]. 4. After a short time the Upsizing Wizard Report will be displayed. This can be printed out.
5. Close the Report window NB Each table in your SQL Server database must have a primary key defined if you wish to add or edit data via your Access Project. This can be done in your Access database before it is upsized, or in the SQL Server database using the Web Data Administrator on the same database. Renaming the original Access database Once the Access database has been moved to the SQL Server and an Access Project created, users must ensure that it is the Access Project version and not the original Access database which they maintain and update. To ensure the correct database is used, rename the original Access database as followsren {dbname}.mdb {dbname}.orig The database from which users will now be working will be called {dbname}.adp. Using your database The Access Project database can be used and maintained using the same features for inputting and updating data as an Access database. Limitations of Access Project One of the main limitations of Access Project is its inability to control the user permissions on the database. For this you should use Web Data Administrator on the same database. Recommendations for Access projects in Access 2010 We continue to support creating and working with.adp files in Access 2010. However, we recommend that developers use the SQL Server design tools provided in SQL Server Management Studio to design database objects such as tables, views and stored procedures, and then use the Access interface to design the forms, reports, macros and modules that connect to those objects. The tools provided by SQL Server provide the most powerful interface for creating SQL Server objects. Create an Access project Use this procedure to create a new Access project (.adp) file in Access 2010. 1. On the File tab, click New. 2. Do one of the following: Create an Access project in the default file location Under Blank Database, type a name for the project in the File Name box using the.adp file name extension. -or- Create an Access project in a different file location i. Under Blank Database, click Browse for a location in which to save your database. ii. In the File New Database dialog box, browse to the location where you want to save the project, or accept the default location. iii. Type a file name for the project in the File name box. iv. In the Save as type list, select Microsoft Office Access Projects (*.adp), and then click OK. 3. Under New Project, click Create. Access prompts you with the following message: Do you want to connect to an existing SQL Server database? If you want to connect to an existing SQL Server database, click Yes and continue with step 4; otherwise, click No and skip to step 5 to create a new SQL Server database. 4. Connect to an existing SQL Server database a. In the Data Link Properties dialog box, enter the required information for the following: Server name Information needed to log on to the server Database name
b. Click Test Connection to verify that the settings are correct and that the connection succeeds. If the connection does not succeed, the Microsoft Data Link Error dialog box displays a message describing the problem. Click OK to close the message, check your settings in the Data Link Properties dialog box, and then click Test Connection again. Also, you might need to check with the SQL Server database administrator for the database you are connecting to, to make sure your settings are correct or that the computer is available. c. After the Microsoft Data Link dialog box displays the message Test connection succeeded, click OK to close the dialog box, and then click OK to close the Data Link Properties dialog box. Access connects the project to the SQL Server database. 5. Create a new SQL Server database a. On the first page of the Microsoft SQL Server Database Wizard, enter the following information: The SQL Server computer you want to use for this database Your logon information A name for the SQL Server database Note To skip the connection process at this time, click Cancel. Access creates the project, but it is not connected to a SQL Server database. Before you can do anything with the project, you will need to connect it to a SQL Server database, which you can do by using the steps in the next section. b. Click Next to continue. Access attempts to connect to the SQL server computer you specified. If Access cannot connect to the SQL server computer, it displays an error message describing the problem. The SQL server computer name or logon information might be incorrect, or you might not have the necessary permissions to create a database on the SQL Server computer that you specified. You might need to check with the SQL Server database administrator for the database you are creating, to make sure your settings are correct or that the computer is available. c. After Access successfully connects to the SQL Server computer, the wizard displays the message: The wizard has all the information it needs to create your SQL Server database. Click Finish to continue. Access creates the SQL Server database and connects it to the project. Connect an existing Access project to a different SQL Server database Use the following procedure if you have an existing Access project that is not connected to a SQL Server database, or if you want to change the SQL Server computer or database to which your project is connected. 1. On the File tab, click Open. 2. In the Open dialog box, select and open the Access project. A Microsoft Office Access Security Notice dialog box might appear. If you trust the source of the database, click Open to continue. 3. On the File tab, click Server, and then click Connection. The Data Link Properties dialog box appears. 4. In the dialog box, enter the required information for the following: Server name Information needed to log on to the server Database name 5. Click Test Connection to verify that the settings are correct and that the connection succeeds. If the connection does not succeed, Access displays an error message describing the problem. Click OK to close the message, check your settings in the Data Link Properties dialog box, and then click Test Connection again. Also, you might need to check with the SQL Server database administrator for the database you are connecting to, to make sure your settings are correct or that the computer is available. 6. After the Microsoft Data Link dialog box displays the message Test connection succeeded, click OK to close the dialog box, and then click OK to close the Data Link Properties dialog box. Access connects the project to the SQL Server database you specified. Copyright 2014 by GO Software Pty Limited