ASP Access database How to configure database file DSN

Source: Internet
Author: User
Tags contains dsn microsoft sql server odbc access database microsoft access database
Access | data | database Program Database Classes

ActiveX Data Objects (ADO) is an easy-to-use and extensible technique for adding database access to a Web page. You can use ADO to write compact and concise scripts to connect to Open database Connectivity (ODBC)-compliant databases and OLE DB-compliant data sources. If you are a scripting person with a certain understanding of database connections, you will find that the ADO command statements are not complex and easy to master. Similarly, if you are an experienced database programmer, you will correctly understand the advanced language-independent and query-processing capabilities of ADO.

Creating an ODBC DSN file

Before you create a database script, you must provide a way to locate, identify, and communicate with the database. The database driver uses data Source Name (DSN) to locate and identify specific ODBC-compliant databases and pass information from the WEB application to the database. Typically, a DSN contains database configuration, user security, and location information, and you can get a table in a Windows NT registry key or a text file.

With ODBC, you can select the type of DSN you want to create: User, System, or file. The user and system DSN are stored in the Windows NT registry. System DSN allows all users to log on to a specific server to access the database, and the user DSN uses the appropriate security credentials to restrict the database to a specific user's connection. File DSNs are used to get tables from text files, provide access to multiple users, and can be easily transferred from one server to another by replicating DSN files. For these reasons, the examples in this topic will use File DSNs.

You can create a DSN-based file by opening Control Panel on the Windows Start menu. Double-click the ODBC icon, and then select the File DSN property page, clicking Add, selecting the database driver, and then clicking Next. Follow the instructions later to configure the DSN that applies to your database software.

To configure a file DSN for a Microsoft Access database

In the Create New Data Source dialog box, select Microsoft Access Driver from the list box, and then click Next. Type your DSN file name, and then click Next. Click Finish to create the data source. In the ODBC Microsoft Access 97 Setup dialog box, click Select. Select the Microsoft Access database file (*.mdb), and then click OK.

Note For performance and reliability reasons, we strongly recommend that you use the client-server database engine to configure data that is driven by such a Web application that must meet simultaneous access by more than 10 users. Although ASP can use any ODBC-compliant database, it is designed to use a client-server database and has undergone rigorous testing, including Microsoft? SQL Server, Oracle, and so on.

ASP supports shared file databases, such as Microsoft? Access or Microsoft? FoxPro) as a valid data source. Although some examples in ASP documents use shared file databases, we recommend that you use this type of database engine only for development or limited configuration scenarios. Shared file databases may not be well suited for client-server databases that meet high demand, high-quality Web applications.

Configure SQL Server database file DSN

Note If the database resides on a remote server, contact your server administrator to obtain additional configuration information; The following procedure uses the ODBC default settings for SQL Server, which may not apply to your hardware configuration. In the Create New Data Source dialog box, select SQL Server from the list box, and then click Next. Type a name for the DSN file, and then click Next. Click Finish to create the data source. Type the name, login ID, and password of the server that is running the SQL service program. In the Create a new data source for SQL Server dialog box, type the name of the server that contains the SQL Server database in the Server list box, and then click Next. Select how you want to verify your login ID. If you want to select SQL Server Authentication, enter a login ID and password, and then click Next. In the Create new data source for SQL Server dialog box, set the default database, the driver for the stored procedure settings, and the ANSI identity, and then click Next. (To get more information, click Help.) In the dialog box (also named "Create a new data source for SQL Server"), select a character conversion method, and then click Next. (For more information, click Help.) In the next dialog box (also named "Create a new data source for SQL Server"), select the login settings. Note Typically, you can only use logs to debug database access issues. In the ODBC Microsoft SQL Server Setup dialog box, click Test Data source. If the DSN is created correctly, the test Results dialog box indicates that the test completed successfully.

[1] [2] [3] [4] [5] Next page



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.