ASP課堂上學到的程序設計
注意下面的標點符號
(
(
(
(
str="我愛你"
response
(
(
response
’調試和查看sql語句寫法是否正確的語句常用到
(
(
(
(
(
If request("username")="admin" then
Response
Else
Response
End if
(
If request("name")="admin" and request("pass")="admin" then
Response
Else
Response
End if
(
a="我"
b="愛"
c="你"
response
(
do while not rs
response
rs
loop
(
for n=
response
if rs
exit for ’跳出for循環
else
rs
end if
next
Now() 函數返回系統時間
Date() 函數返回當前系統日期
CStr(int) 函數轉化一個表達式為字符串
CInt(string) 將一個表達式轉化為數字類型
Trim(request("username")) 函數去掉字符串左右的空格
Left(rs("title")
Len(string) 函數返回字符串的長度
request
mid(str
right(str
Lcase(str)
Ucase(str)
Ltrim(str)
Rtrim(str)
replace(str
替換字符串
注
InStr([起始字符
(
db="mydata
Set conn = Server
cServer
conn
(
’如果你的服務器采用較老版本Access驅動
db="mydata
Set conn = Server
c & Server
conn
包括取全部記錄
Set Rs=Server
SqlStr="select * from news"
Rs
選取幾條數據
Set Rs=Server
SqlStr="select top
Rs
選取一條指定表中id字段數值的數據
Set Rs=Server
SqlStr="select * from news where id="&request("id")
Rs
獲取一條表單傳過來的數據
dim a
a=request
b=request("b")
c=request("c")
d=request("d")
sqlstr
conn
response
修改一條指定表中id字段數值的數據
dim a
a=request("id")
d=request
e=request
sqlstr="update huiyuanbiao set yonghuming=’"&d&"’
response
conn
response
刪除一條指定表中id字段數值的數據
dim a
a=request("delid")
sqlstr="delete from huiyuanbiao where id="&a
conn
response
(
Set Rs=Server
SqlStr="select * from news"
Rs
(
Set Rs=Server
SqlStr="select top
Rs
(
不帶連接的寫法
for n=
response
if rs
exit for
else
rs
end if
next
帶連接的寫法
for n=
response
if rs
exit for
else
rs
end if
next
(
Set Rs=Server
SqlStr="select * from news"
Rs
Rs
Rs("title")=trim(request
Rs("neirong")=request
Rs("date")=now()
rs
(
Set Rs=Server
SqlStr="select * from news where id="&request("id")
Rs
Rs("title")=trim(request("title"))
Rs("neirong")=request("neirong")
Rs("date")=now()
rs
(
Set Rs=Server
SqlStr="select * from news where id="&request("id")
Rs
rs
<form method="post" action="addsave
<input type="text" name="a">
<input type="text" name="b">
<input type="submit" name="Submit" value="提交">
</form>
response
response
response
在網頁的頭部加入
Application
Application("counter") = Application("counter") +
Application
在需要顯示計數內容的網頁的地方
response
From:http://tw.wingwit.com/Article/program/net/201311/14269.html