Recently, the network administrator gave me a space on the server to display some information. In order to facilitate everyone's query on the Internet, we built a simple ASP query system, which linked to the Access database in MDB format. Before the network was built, the data was summarized using Excel spreadsheet software in the format of XLS. Can't convert XLS files to MDB format? The first thing that comes to mind is to save the table file as MDB format in Excel, but there is no database MDB format in "Save File Type". So can XLS be opened with Access? Although the result can be opened, what is created is a database linked to the table. It cannot be opened without the linked table file. It is not a real MDB database! Can't the XLS format and MDB format be converted? After some exploration, I finally found a solution. The method is:
1. Open the Access database software, in the pop-up window, select "Empty Access Database" in "New Database", and then in the "File New Database" window Set the database file name. Here I enter "DJMessage" as the database name.
2. Click "Import..." in "Get External Data" under the "File" menu. In the "Import" window that opens, first select "Microsoft Excel (?.xls)" for "File Type". Select the storage path of the XLS file in the "Search Range", then select the XLS file to be converted, click "Import" to open the "Import Data Wizard" window, and follow this wizard to complete the data import step by step. The specific steps are as follows:
The first step, worksheet selection: From the displayed worksheet, select the worksheet to store data (Figure 1). Step 2. Title setting: In Excel, column titles are generally set in the first row of the table. In this step, depending on the XLS table, set whether the first row of the table contains column titles. If the first row of the table contains column titles, For titles, you need to select "The first row contains column titles". If there are multiple row and column titles in the table, these column titles must be deleted before importing the data. Otherwise, the titles will be imported into the database as data. Step 3. Data saving settings: In this step, according to the default settings, select the data saving location as "New Table". Step 4. Field settings: If "The first row contains column titles" is checked in the second step, the column titles will be displayed in the "Field Name", otherwise the "Field Name" will be displayed. 1", "Field 2" and other names. Just re-enter the new name in "Field Name" to set the field name of the column (Figure 2). Step 5. Primary key setting: Setting the primary key can avoid duplication of data on the one hand, and can also speed up data query on the other hand. The database I want to build is used for ASP web page query, and of course it is necessary to set the primary key, which is selected here. It is the default setting of "Add primary key with Access". Step 6. Table name setting: Create a table name under "Import to table" and import the data into this table. I entered "mytable" as the table name, and then clicked "Finish" to complete the data import. Return to the database window and see that a "mytable" data table has been added, so that the generated DJMessage.mdb is a real database. Copy DJMessage.mdb to the ASP web page directory, debug the query system, everything is OK!
Figure 1
Figure 2
has said so much. Finally, the XLS file is converted to MDB format. Next, let’s talk about how to convert MDB to XLS format. After all, table files are easier to use than database files in terms of editing, typesetting, and printing. Converting MDB to XLS format is relatively simple. Open the database file DJMessage.mdb, select the "mytable" table, and then click "Export" in the "File" menu. In the "Export table mytable as" window that opens, Select the save file type as "Microsoft Excel 97-2000 (?.xls)" (Figure 3), enter the file name, and then click "Save" to convert the MDB file in database format into an XLS file in table format.
Figure 3