Beginner's News | web | Beginner ASP is a good thing, its powerful interaction ability and data processing ability make it become the favorite of the commercial website. However, the design and debugging of ASP programs is not easy, just high-end server +windows NT operating system +iis servers +sql Server database system configuration is not our individual users can have access to. Is the ASP really not with us these individual users? Do we have to have such a luxurious hardware and software environment to embark on the study of the ASP's road?
After the author's efforts, finally using some commonly used software to configure a full-featured ASP development debugging environment, and in this developed a number of small systems.
First, hardware configuration
pⅲ450 dual cpu+1g memory +10g SCSI hard drives above, please don't be afraid, this is just a standard configuration for a Web server that uses Windows NT. Of course, we don't need such a configuration, we just want a machine that can run Windows 98 smoothly. What You are using p100+16m memory +540m hard drive, then go to a subordinate. )
Second, the software configuration
First of all, we need to install Windows 98, which I believe everyone will be. (What, you can't even this, that ASP also need not learn, advanced Literacy Class bar.) )
Second, we need to install personal Web Server (PWS), you ask where it can be found, too simple, in the Windows 98 CD-ROM, there is a directory called "Add-ones", which has a directory named "PWS", The SETUP.EXE on the inside of the operation began to install.
When Setup runs to the minimum, typical, custom installation selection, select Custom, then Personal Web Server (PWS), and then press show subcomponents. Then select document, press Show subcomponents, and then select Active Server Page. This component will install a number of documents, including ASP tutorials, VBScript tutorials, and JScript tutorials, to the benefit of future development. When you have finished selecting, press OK and then press next to start setting up the directory where the WWW service document is stored, the default is "C:inetpubwwwroot", and it is recommended that you do not change it. The "MTS installation Folder" is then set and the default is "C:Program Filesmts" and is not recommended for change. After you press "next" again, the most critical installation begins, please be patient, this configuration of PWS about 90 trillion, it may take a considerable time.
After the installation is complete, run the Office 97 installer again. (What, this is not!) If you have SQL, oracal, infomix these large databases that will do, but it seems a bit overqualified. Select Custom Install, and then in the Components list, select Microsoft Access and Data access (users who have used VB please don't make a mistake, this data Access is just a driver and a tool for connecting to databases in various data formats, is not the VB in the Small database software).
So far, need to install the software and all installed, but not too early, now your ASP has not been able to deal with the database, (what, you do not need to deal with the database, then you use ASP why, on the interactive Java script is not worse than the ASP, but also learn a lot?) Next, we also need to do both the database creation and ODBC setup steps.
third, database creation
A good program = data + algorithm. For a database program, the database is essential. We'll create one with access below.
1) please start Access. Because here we are just giving the reader a demonstration, so you create a very simple database that includes only one table and only one field in the table (for the concepts of database, table, field, check out a good database book or help this document for access).
2 Select "Empty Database" in "New Database" and press "OK" and enter the file name of the database (for c:test in this demonstration). MDB) and press "create".
3 Select "Table" and press "new".
4 Enter a field with the field name "name", the data format is "text" and the field size is "10".
5 Close the window and ask you in the pop-up window "Do you want to save changes to the ' Table 1 ' design?" When selected, and set table name to Table1.
6 will then pop up the window to tell you that you have not created a "primary key", "yes" or "no", "yes" or "no" relationship is not very small, choose one randomly.
7 to this, a very basic database will be completed, of course, in order to facilitate our testing work, please reactivate the "table1" just established, and enter some data.
four, set up ODBC
Before setting up ODBC, it is necessary to explain the concept of ODBC to the reader, which is conducive to understanding the following content. ODBC (open Databases connectivity Open Database interconnection) is an industry standard introduced by Microsoft, an open, vendor-independent API application interface that enables access to a variety of personal computers, minicomputer, and host systems across platforms. As an industry standard, the vast majority of database vendors, most applications and tool software vendors provide ODBC interfaces or provide ODBC support for their products, including commonly used SQL Servers, oracal, Informix, and so on.
All we have to do is to provide a way to locate, identify, and communicate with the database before creating the database script. 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, we can select the type of DSN you want to create: User, System, or file. 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. In this example, we use a file DSN. Of course, because you use a different database, the specific settings are slightly different, where we only describe access, SQL Server, oracal three database ODBC settings.
[1] [2] Next page