Talking about the ideas and error correction of ASP programming

zhaozj2021-02-16  46

For beginners programming with ASP technology, there is no first feeling, and the author has had such an experience. After some "hardship", you will find inspiration. Some experiences accumulated in my programming, proposed to be cultivated, dedicated to the reader.

1 First learn some examples of examples.

After receiving the task, don't blindly eager to write code, but first look at the example of successful people, then modify or imitate debugging, which will speed up your familiar speed. For example, there is often such an example in the textbook of the ASP programming, that is, the statement of the current time of the system: <% = now ()%>, don't look at this simple statement, but inside the programming ideology and format of the ASP. Will bring great help to your work behind you. For example, whether the IIS (Internet Information Server Web Server works normally, the test of one statement is sufficient.

2 After installing ODBC on Windows NT, you want to test and start programming test after testing and background databases. Maybe you don't understand the meaning, I explain here: For example, the background database is Oracle, then you first install SQL * NET (or Net 8) on NT Sever, then configure ODBC, determine and operate and Oracle database. You can test with SQL * Plus, and choose the same character set as the Oracle database, this work is done in the registry. Finally, after the ODBC is tested and the Oracle database is connected, the WEB Server to the background database end is completed, and the programming work will be started below. Conversely, if you first program, then do ODBC's work, then you can't debug the program correct, it may greatly reduce programming efficiency. In the ODBC configuration, you want to select Microsoft Odbc for Oracle, do not select Oracle ODBC Driver, otherwise you cannot connect with the database.

In the ASP program, the statement that connects to the database is relatively fixed. For example, SET CONN = Server.createObject ("AdoDb.Connection") Conn.open "ODBCLINK", "O7PEOPLE", "people" here, ODBCLINK is The name of the data source can be said to be the definition of ODBC and database connections. O7PEOPLE is a username of Oracle, and peoplepd is the user's O7PEOPLE. 3 Record the error information to find the error correction. In programming, during debugging, it is an error, error correction cycle process, but time is long, it will find some rules, and the efficiency of the rule is greatly improved. 3.1 Error Information: Microsoft OLE DB Provider for ODBC Drivers Error '80040E14' [Microsoft] [ODBC Driver for Oracle] [Oracle] ORA-00933: SQL Command Not Properly Ended /Default.asp, line 781 This error, general Is there a problem with the "SQL statement" defined "SQL statement" when executing conn.execute ("SQL Statement"), checks the problem, such as the date format, and so on. Zhezhong 3.2 Error Information: AdoDb.field Error '800A0BCD' BOF or EOF is "true", or the current record has been deleted, but the application requires the current record. /LZJSBLR.ASP, line 123 This error is generally occurring in the process of performing the following statements: SET RS = conn.execute ("SQL statement" Varnum1 = RS (0) rs.close RS (0) None Significance or meaningless, also check the correctness of the "SQL statement". 3.3 Error information: Microsoft VBScript compiler error error '800A0409' Une endless string =pe/default.asp, line 86 INSERT_SQL = INSERT_SQL & DWDM & ", '" & D1 & ",'" & t1 & "'" "& T2 &"', ---------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------ ^ preferred error is also on the definition of SQL statement, check Pairing of quotation marks, single quotes, etc. 4 is a browser-based online user registration process, and the author applies some techniques to be interested in readers.

... <<% 'and database connection set conn = server.createObject ("adoDb.connection" conn.open "odbclink", "o7people", "peoplepd"' put the selected data into the selection Box set = conn.execute ("Select DWMC from Tab_dw Order By DWDM)%> <% Do While Not Rs.eof%>

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

New Post(0)