第四讲 Asp 内置对象. Asp 内置对象. ASP 编程代码包括两部分: 1 、一种脚本语言 2 、一组内置对象. 使用 VBSCRIPT 编写的 ASP 程序:. <HTML> <BODY> <% select case Request.Form("add") case "tsinghua" Response.Redirect "http://www.tsinghua.edu.cn" case "yahoo" Response.Redirect "http://www.yahoo.com" case "sina"
An Image/Link below is provided (as is) to download presentation
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.Content is provided to you AS IS for your information and personal use only.Download presentation by click this link.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.During download, if you can't get a presentation, the file might be deleted by the publisher.
使用VBSCRIPT编写的ASP程序: <HTML> <BODY> <% select case Request.Form("add") case "tsinghua" Response.Redirect "http://www.tsinghua.edu.cn" case "yahoo" Response.Redirect "http://www.yahoo.com" case "sina" Response.Redirect "http://www.sina.com.cn" end select %> </BODY> </HTML>
Asp内置对象 • Active Server Pages (ASP) 结构五个重要的内建对象: • Request • Response • Server • Session • Application
7.3.1 Select语句 • 此时可以使用Select语句来取得满足特定条件的记录集。也就是说可以从数据库中查询有关记录。 • Select [Top(数值)] 字段列表From 表[Where 条件] [Order By 字段] [Group By 字段]
Select语句示例 • Select * From users • Select real_name,email From users • Select Top 3 * From users • Select real_name,(submit_date+365) As new_date From users • Select * From users Where submit_date<#2003-11-1# AND real_name=“建波”
Select语句示例 • Select * From users Where real_name like “%勇%” • Select * From users Order By real_name DESC • Select Count(*) As total From users Where submit_date<#2003-11-1# • Select users.real_name,day_log.log_date,day_log.IP From users,day_log Where users.user_name=day_log.user_name
7.3.2 Insert语句 • 向用户表Uesrs中增加新成员时,就需要将新用户的数据插入到表users中。此时,可以使用SQL语言中的Insert语句来实现这个功能。 • Insert Into 表(字段1,字段2,…) Values(字段1的值,字段2的值,…)
Insert语句示例 • Insert Into users ( user_name, password,real_name,tel,email,submit_date) Values(“mengmeng”,”123456”,”萌萌”,”6887150”,”mengmeng@henan.com”, #2003-11-2#)
Insert语句示例 • Insert Into users ( user_name ) Values(“liya”) • Insert Into users ( user_name, real_name ) Values(“feiyun”,”费云”) • Insert Into users ( user_name, submit_date ) Values(“luofang”,#2003-12-5#) • Insert Into users ( user_name, age) Values(“zhangpeng”,23)