Notes ASP Learning Notes (i)
1. Highlight text
<em> Text to display </em>
2. According to the user choice, makes the corresponding reaction (realizes in the client)
SELECT case Document.Form1.card.options (selectedindex). Text
Case "Value1"
Option1
Case "value2"
Option2
......
End SELECT
3. A sub function in VBScript does not return a value
function functions will return a value
Sub Procedure1 () must be parenthesized before band public| Private to limit the scope of use of this function. If private, only programs that declare the procedure in advance can invoke it.
One example:
Function Prog (Value1)
Prog=value1*22
End Function
X=prog (22)
Response.Write (x)
4. Native DSN information is stored in the registry and is available only to the current user.
System DSN can be used by all users of this machine
A file DSN is stored in a. dsn file and can be accessed by any user on the LAN if it is in a network shared folder.
5. Microsoft's data access is divided into: used for local DAO, ADO for the network, RDO for remote access.
6. Two parts of sql: DDL,DML
7. SELECT field if contain space with [] enclose
8.SELECT Id,xm,m,e,c,m+e+c as SUM from SCORE order by M+e+c DESC default to Ascending
SELECT Top * FORM STUDENT WHERE score>=60
The 9.DELETE from student where score<60 ' Jollo the WHERE clause deletes all records.
10.UPDATE TABLE1 SET dd=dd+2 WHERE dd like ' 2% ' indicates that the DD is a 02-preceded record; There is no ', ' separation between multiple update records after set.
11.INSERT into SCORE (id,xm,score) VALUES (33333, ' LIU ', 88) ' character data need to be enclosed in single quotes
12.sql= "UPDATE system SET maxonlinetime= '" &now () & "', maxonline=" &application ("C_useronline")) ' Where Maxonlinetime is a date-type data, MaxOnline is a numeric data.
13.SELECT A as aa,b as BB into SS will establish the SS data table.
14.SELECT * into MYBOOK from book WHERE whose=my
15.SET session ("Object1") =server. CreateObject ("Yourobjectname") will establish an object with session scope, otherwise object is only a page scope.
16.SESSION applies to a user; application applies to multiple users.
17.exec= "INSERT into Guestbook (nickname,content,e_mail) VALUES (' &nickname&" ', ' "&neirong&" ', ' " &mail& "')" ' General format
18.<a href= "Javascript:window.history.back ();" > Return to Previous page </a> ' is generally used in case of error in submitting information or other situations requiring return.
20.connstr= "dbq=" +server.mappath ("Lyb.mdb") + ";D efaultdir=;D river={microsoft Access DRIVER (*.mdb)};" ' Connection string
21.<body onload= "window.status= ' Page is loaded! '" > ' The status bar displays results when the page is loaded
22.<script language= "JavaScript" >
Step through its child windows from this level of Windows
if (window.frames!=null) {
for (i=0; i<window.frames.length; i++)
Window.alert ("child window" +i+ "is named" +window.frames (i). Name);
}
</script>
23. Remove the underline of the connection
<style type= "Text/css" >
<!--
a:link {Text-decoration:none}
-->
</style>
24.SQL fields, the field name should not be taken as from, and so may be the system reserved word name, otherwise it will cause you a lot of trouble.
25.window.location.href= "www.microsoft.com"//can be used in javascript,vbscript. Use client script to transfer to another page
The 26.isnull () function is true to indicate that it is invalid, and IsEmpty () is true to indicate that it has not been initialized and that IsNothing () is used only for objects.
27.onmouseout= "Mouseout" (This, ' #ccccff '); "onmouseover=" MouseOver (This, ' #C82890 ');
Onclick= "MouseClick (this);"//event-triggered processing.
28.<form method= "POST" action= "member_reg.asp" Id=form_username name=form_username language=javascript onsubmit= " Return Form_username_onsubmit () "> General client-side data validation is done in this way.
29. Picture buttons can be implemented like this:
<input type=image src= "" >
<button type=submit></button>
<button type=reset></button>
<button type=button></button>
If you do not want to use the picture, you can also write
<button type=submit> Submit </button>
30. Member registration, add the record when the name of the check (with 28 with the use)
<script Id=clienteventhandlersjs language=javascript>
<!--
function Form_username_onsubmit () {
return check ();
}
function Check ()
{
var username=document.form_username.username;
if (username.value.length<=0 | | username.value.length>8)
{
Window.alert ("User name cannot be empty and length cannot exceed 8 characters!");
Username.focus ();
return false;
}
if (Hasbug (Username.value))
{
Window.alert ("User name cannot contain nonstandard characters!");
Username.focus ();
return false;
}
return true;
}
function Hasbug (strtest)
{
var str = new String (strtest)
Strmatch =/["']/;
if (Str.search (strmatch)!=-1)
return true;
Else
return false;
}
-->
</SCRIPT>
31. Member registration of a more complete inspection *****************************************************************************************
<script Id=clienteventhandlersjs language=javascript>
<!--
function Form_reg_onsubmit () {
var Form=document.form_reg;
Re