Use SQL Server and MSDE in ASP

zhaozj2021-02-16  48

The author is the Star of Microsoft Community in February Microsoft China Community Star

Microsoft's SQL Server is a database server software that is commonly used in the Windows environment, as well as one of the frequently used databases in ASP applications. This article mainly tells some techniques that SQL Server uses in combination with ASP.

First, SQL Server acquisition and installation

If it is a commercial application, it is recommended to purchase SQL Server's standard version or enterprise version, the price is more than 20,000 (more expensive than Windows); if it is personal learning, or limited financial resources, you can use the desktop version - msde. At present, there is attached to .NET Framework SDK, ASP.NET Web Matrix, Office XP Professional, Developer, Project Server 2002, development tools, and server class software. In addition, the SQL Server SP3 provided in the Microsoft site also contains MSDE or SP3. Because it is a simplified version, MSDE does not provide graphical management tools. Since SQL Server is a wizard installation, details are not described here. One thing to note is that "SQL and Windows Integrated Mixed Verification" mode should be selected when installing. For database servers already installed, you can modify it in the Security page of its property window. MSDE SP3 can be downloaded at http://www.microsoft.com/china/sql/downloads/sp3.asp. Select the language on the right side of the page, click the "Go" button to enter the download page. The Chinese Simplified File Name is CHS_SQL2kDesksp3.exe, the size is 73735 KB. Run this file and extract the installer to a folder. Because we need MSDE to work in SQL authentication mode, and the SP3 version requires the SA password to be blank, you need to modify the setup.ini file, add the following two lines to the [Option] section: securityMode = SQLSAPWD = management password then to DOS Setup / i setup / sqlrun01.msi / settings setup.ini can be. After installing, the startup group of the Start menu adds a Services Manager icon. It is installed. Start your computer or run the service manager to start the database server.

Second, use the database in ASP

When you connect SQL Server in ASP, you often appear 80004005 errors. This is because the database server is set to a Windows integrated verification method, and the Account used by the ASP is disabled from accessing the database. The method is to set the database server to a hybrid verification mode allows it to log in to the database via the username and password. Writing an OLEDB string is another problem that plasmunicates many people. In fact, the method is simple. Take the connection SQL Server as an example: 1. Create an extension UDL file, and open 2. Select Microsoft Ole DB Provider for SQL Server in the Provider page, then return to the "Connection" page, enter the address of the database server And select "Use the specified user name and password", enter the username and password to connect the database, and then select the database name to use or enter the database name to use in the "Select the Database" drop-down box. Finally, you can click the "Test Connection" button to test the parameter correct. Note You cannot choose "Use WindowsNT Integration Security Settings", otherwise, even if the test is successful, it cannot be used in ASP. 3, finally open this file with a program with 2000 / XP notepad or Word, the third line is the OLEDB connection string.

Third, import database

The general use of SQL Server will provide a SQL file to establish a database structure. The following is explained the method of calling the SQL file in SQL Server and MSDE, respectively:

转载请注明原文地址:https://www.9cbs.com/read-28262.html

New Post(0)