Convert XLS and MDB file formats using Access

Source: Internet
Author: User
Tags mdb database

Recently, the Network Administrator assigned me a space on the server to show some information. In order to facilitate the query on the network, we made a simple ASP Query System, which is linked to the Access database in the MDB format, documents are summarized in Excel. The format is XLS. Can I convert the XLS file to MDB?

The first thought is to save the table file in Excel as MDB, but there is no database MDB format in "save file type. Can I use Access to open XLS? Although the results can be opened, a database linked to the table is created. The database cannot be opened without the linked table file. It is not a real MDB database! Cannot XLS format be converted to MDB format? After some exploration, I finally found the way to understand the problem. The method is:

1. Open the Access database software. In the pop-up window, select "Empty Access Database" in "New Database", and set the database file name in the "file new database" window, here, I enter "DJMessage" as the database name.

2. Click "import..." in "obtain external data" under "File... ", in the open" import "window, select" file type "as" Microsoft Excel(.xls) ", and select the path to store the XLS file in" search range, select the XLS file to be converted, click "import", open the "Import Data wizard" window, follow this wizard to complete data import step by step, the specific steps are as follows:

Import data table wizard

Step 1. Select a worksheet: select the worksheet to store data from the displayed Worksheet (1 ).

Step 2: Set the title: In Excel, the column title is usually set in the first row of the table. In this step, according to The XLS table, set whether the first row of the table contains the column title. If the first row column title is selected, select "the first row contains the column title". If the table contains multiple row and column titles, delete the headers of these columns before importing data. Otherwise, the headers are imported to the database as data.

Step 3: Set Data Storage: select "new table" as the default data storage location ".

Step 4. Field settings: If "First row contains Column Title" is selected in step 2, the column title is displayed in "field name, otherwise, "field name" displays "Field 1", "Field 2", and other names. You only need to enter a new name in "field name" to set the field name (2) for this column ).

Step 5: Set the primary key. On the one hand, to avoid data duplication, on the other hand, it can speed up data query. The database I want to create is used in combination with ASP Web page query, of course, you must set the primary key. Here, the default setting "add a primary key with Access" is selected.

Step 6: Set the table name: Create a table name under "import to table" and import the data to this table. I enter "mytable" as the table name, click "finish" to end the data import. Return to the Database window and you will see that a "mytable" data table is added, so that the generated DJMessage. mdb is a real database. Copy DJMessage. mdb to the ASP Webpage directory and debug the system. Everything is OK!

Import data table wizard Import data table wizard

After talking about this, we finally converted the XLS file into the MDB format. Next, let's talk about how to convert the mdb to the xls format. After all, in terms of editing, formatting, and printing table files, it is easier to use than database files.

The XLS format for MDB conversion is much simpler. Open the database file DJMessage. mdb, select the "mytable" table, click "Export" in the "file" menu, and in the "Export mytable as" window that opens, select "Microsoft Excel 97-2000(.xls)" (3) as the Save file type, enter the file name, and click "save" to convert the MDB File in database format to an XLS file in table format.

(

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.