精品久久看,欧美成人久久一级c片免费,日本加勒比在线精品视频,国产一区二区三区免费大片天美,国产成人精品999在线,97理论三级九七午夜在线观看

東坡下載:內(nèi)容最豐富最安全的下載站!

首頁(yè)IT技術(shù) → 最新整理站長(zhǎng)建站常用的SQL和ASP技巧大全免費(fèi)分享

最新整理站長(zhǎng)建站常用的SQL和ASP技巧大全免費(fèi)分享

相關(guān)文章發(fā)表評(píng)論 來(lái)源:本站時(shí)間:2011/7/10 11:20:50字體大小:A-A+

更多

作者:專題點(diǎn)擊:31次評(píng)論:0次標(biāo)簽: SQL

  • 類型:服務(wù)器區(qū)大小:3.4M語(yǔ)言:中文 評(píng)分:2.5
  • 標(biāo)簽:
立即下載

下面最新整理一些站長(zhǎng)建站常用的SQL和ASP技巧大全,免費(fèi)提供給大家一起分享。

sql常用命令方法!!!
(1) 數(shù)據(jù)記錄篩選:

sql="select * from 數(shù)據(jù)表 where 字段名=字段值 order by 字段名 [desc]" 

sql="select * from 數(shù)據(jù)表 where 字段名 like ''%字段值%'' order by 字段名 [desc]" 

sql="select top 10 * from 數(shù)據(jù)表 where 字段名 order by 字段名 [desc]" 

sql="select * from 數(shù)據(jù)表 where 字段名 in (''值1'',''值2'',''值3'')" 

sql="select * from 數(shù)據(jù)表 where 字段名 between 值1 and 值2" 

 


(2) 更新數(shù)據(jù)記錄:

sql="update 數(shù)據(jù)表 set 字段名=字段值 where 條件表達(dá)式" 

sql="update 數(shù)據(jù)表 set 字段1=值1,字段2=值2 …… 字段n=值n where 條件表達(dá)式" 

 



(3) 刪除數(shù)據(jù)記錄:

sql="delete from 數(shù)據(jù)表 where 條件表達(dá)式" 

sql="delete from 數(shù)據(jù)表" (將數(shù)據(jù)表所有記錄刪除) 

 



(4) 添加數(shù)據(jù)記錄:

sql="insert into 數(shù)據(jù)表 (字段1,字段2,字段3 …) valuess (值1,值2,值3 …)" 

sql="insert into 目標(biāo)數(shù)據(jù)表 select * from 源數(shù)據(jù)表" (把源數(shù)據(jù)表的記錄添加到目標(biāo)數(shù)據(jù)表) 

 



(5) 數(shù)據(jù)記錄統(tǒng)計(jì)函數(shù):

AVG(字段名) 得出一個(gè)表格欄平均值
COUNT(*|字段名) 對(duì)數(shù)據(jù)行數(shù)的統(tǒng)計(jì)或?qū)δ骋粰谟兄档臄?shù)據(jù)行數(shù)統(tǒng)計(jì)
MAX(字段名) 取得一個(gè)表格欄最大的值
MIN(字段名) 取得一個(gè)表格欄最小的值
SUM(字段名) 把數(shù)據(jù)欄的值相加

引用以上函數(shù)的方法:

sql="select sum(字段名) as 別名 from 數(shù)據(jù)表 where 條件表達(dá)式" 
set rs=conn.excute(sql) 

 



用 rs("別名") 獲取統(tǒng)的計(jì)值,其它函數(shù)運(yùn)用同上。

(5) 數(shù)據(jù)表的建立和刪除:

CREATE TABLE 數(shù)據(jù)表名稱(字段1 類型1(長(zhǎng)度),字段2 類型2(長(zhǎng)度) …… )

例:CREATE TABLE tab01(name varchar(50),datetime default now())

DROP TABLE 數(shù)據(jù)表名稱 (永久性刪除一個(gè)數(shù)據(jù)表)

select distinct * into yjkc2 from yjkc
drop table yjkc
select * into yjkc from yjkc2
drop table yjkc2

 



SQL連接方式

dim conn 
set conn=server.createobject("ADODB.connection") 
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=服務(wù)器;UID=用戶名;PWD=密碼;DATABASE=表名;"

 


access連接方式

dim conn 
dim connstr
on error resume next
connstr="DBQ="+server.mappath("數(shù)據(jù)庫(kù)路徑")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr 

 



包含頁(yè)

<!--#include file=文件名 -->

 




調(diào)用表

打開數(shù)據(jù)庫(kù)之后固定修改某個(gè)字段

conn.execute("Update 表名 Set 字段=字段+1 Where 字段=變量"

 



刪除內(nèi)容

set rs=server.createobject("adodb.recordset")
sql="select * from 表名 where 字段=變量"
rs.open sql,conn,1,3
有圖片就刪除圖片
Picture=rs("newspic") 
set fs=server.CreateObject("scripting.filesystemobject") 
Picture=server.MapPath(Picture) 
if fs.FileExists(Picture) then 
fs.DeleteFile Picture,true 
end if 
rs.delete
rs.update
response.redirect request.servervariables("http_referer")
end if



分頁(yè)

<table width="98%" border="0" cellspacing="1" cellpadding="3" bgcolor="cccccc">
<tr bgcolor="f5f5f5">
<td width=10% align=center>
<font color="">id&nbsp;
</td>
<td width=40% align=center>關(guān) 鍵 詞;</td>
<td width=10% align=center>價(jià)&nbsp;&nbsp;格</td>
<td width=20% align=center>修&nbsp;&nbsp;改</td>
<td width=20% align=center>刪&nbsp;&nbsp;除</td>
</tr>
<%
If Request.QueryString("page") = "" or Request.QueryString("page") = 0 then
page = 1
Else
page = CINT(Request.QueryString("page"))
End If
if request("pm")="" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from p_words order by id desc"
rs.open sql,conn,1,1
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from p_words where pm_name like '%"&request("pm")&"%'"
rs.open sql,conn,1,1
end if
if rs.eof and rs.bof then%>
<tr >
<td width=10% align=center colspan="6" >
暫時(shí)沒(méi)有記錄!!<br>
</td>
</tr>
<%
else
%>
<%
RS.PageSize=10'設(shè)置每頁(yè)記錄數(shù)           
Dim TotalPages              
TotalPages = RS.PageCount              
              
If page>RS.Pagecount Then               
page=RS.Pagecount              
end if              
              
RS.AbsolutePage=page
rs.CacheSize = RS.PageSize'設(shè)置最大記錄數(shù)  
Dim Totalcount              
Totalcount =INT(RS.recordcount)              
              
StartPageNum=1              
do while StartPageNum+10<=page              
StartPageNum=StartPageNum+10              
Loop              
                  
EndPageNum=StartPageNum+9              
              
If EndPageNum>RS.Pagecount then EndPageNum=RS.Pagecount %>
<%I=0
p=RS.PageSize*(page-1)              
do while (Not RS.Eof) and (I<RS.PageSize)              
p=p+1%>

<form action="?act=move&id=<%=rs("id")%>" method=post name=form1>
<tr bgcolor="#FFFFFF">
<td align=center><%=rs("id")%></td>
<td><input type=text name="pm_name" size=12 value="<%=rs("pm_name")%>"></td>
<td align=center><input type=text name="pm_p" size=8 value="<%=rs("pm_p")%>"></td>
<td align=center><input type='submit' class='button' value='修改'></td>
<td align=center><input type="button" name="Submit" value="刪除" class="button" onclick="location='biglist.asp?act=del&id=<%=rs("id")%>'"></td>
</tr>
</form>

<%I=I+1              
RS.MoveNext              
Loop%> 
              
  

<tr> <td colspan="6" align=right height=30>
  共有<font color=red><%=rs.recordcount%></font>個(gè)關(guān)鍵詞,<font color=red><%=page%></font>/<%=TotalPages%>頁(yè)
【<a href="<%=request.ServerVariables("URL")%>?page=1">首頁(yè)</a>】 
<% if page>1 then %>
【<a href="<%=request.ServerVariables("URL")%>?page=<%=StartPageNum-1%>">上一頁(yè)</a>】
<%else%>
<%end if%>
<% For I=StartPageNum to EndPageNum                          
      if I<>page then %><A href="?page=<%=I%>"><u><%=I%></u>&nbsp;</A><% else %><font color=red><%=I%></font>&nbsp;<% end if %><% Next %><% if EndPageNum<RS.Pagecount then %>
【<a href="<%=request.ServerVariables("URL")%>?page=<%=EndcPageNum+i%>">下一頁(yè)</a>】
<%end if%>
【<a href="<%=request.ServerVariables("URL")%>?page=<%=TotalPages%>">尾頁(yè)</a>】

</td></tr>


<%
end if
rs.close
%>  

</table>




常用JAVA

response.write"<SCRIPT language=java script>alert('該關(guān)鍵詞已經(jīng)存在。');"
response.write"java script:history.go(-1)</SCRIPT>"
'response.redirect "biglist.asp"
'response.write"this.location.href='index.asp';</SCRIPT>" 
'response.redirect request.servervariables("http_referer")
response.end



常用命令
兩個(gè)表循環(huán)

<%
dim crs1
dim csql1
Set crs1= Server.CreateObject("ADODB.Recordset") 
csql1="select * from commercetype" 
crs1.open csql1,conn,1,1
%>
<%do while not crs1.eof%>
<%
Set all= Server.CreateObject("ADODB.Recordset")
csql1="select * from Commerce where Typeid="&crs1("Typeid")
all.open csql1,conn,1,1

%>
<td width="20%" height=17 bgcolor="#E4F4FC" valign=middle>
<font color=red>
<%if not all.eof then%>
<%=all.recordcount%>
<%else%>
0
<%end if%>
</font>
</td>
<%
crs1.movenext
loop
%>


去掉太長(zhǎng)的錄入文字:

<td style="word-wrap:break-word;word-break:break-all;">
<%=ltrim(arr(j))%>


去掉左空格
instr(request.form("t"),",")>0
查驗(yàn)是否有,號(hào)
arr=split(request.form("t"),",")
去掉,并付值給arr
ubound(arr)
個(gè)數(shù)

ASP函數(shù)介紹

??
??1. 函數(shù)array() 功能:創(chuàng)建一個(gè)數(shù)組變量 格式:array(list) 參數(shù):list 為數(shù)組變量中的每個(gè)數(shù)值列,中間用逗號(hào)間隔 例子: 結(jié)果: i 被賦予為數(shù)組
??
??2. 函數(shù)Cint() 功能:將一表達(dá)式/其它類型的變量轉(zhuǎn)換成整數(shù)類型(int) 格式:Cint(expression) 參數(shù):expression 是任何有效的表達(dá)式/其它類型的變量 例子: 結(jié)果: 236 函數(shù)Cint()將字符"234"轉(zhuǎn)換 成整數(shù)234.如果表達(dá)式為空, 或者無(wú)效時(shí),返回值為0;
??
??
??3. 函數(shù):Creatobject() 功能:創(chuàng)建及返回一個(gè)ActiveX對(duì)象. 格式:Creatobject(obname) 參數(shù):obname 是對(duì)象的名稱 例子: 結(jié)果:
??
??4. 函數(shù)Cstr() 功能:將一表達(dá)式/其它類型的變量轉(zhuǎn)換成字符類型(string) 格式:Cstr(expression) 參數(shù):expression是任何有效的表達(dá)式/其它類型的變量 例子: 結(jié)果:函數(shù)Cstr()將整數(shù) 5 轉(zhuǎn)換 成字符"5".
??
??5. 函數(shù)Date() 功能:返回當(dāng)前系統(tǒng)(server端)的日期 格式:Date() 參數(shù):無(wú) 例子<% date () %> 結(jié)果:05/10/00
??
??
??6. #.函數(shù)Dateadd() 功能:計(jì)算某個(gè)指定的時(shí)間和 格式:dateadd(timeinterval,number,date) 參數(shù):timeinterval是時(shí)間單位(月,日..); number是時(shí)間間隔值,date是時(shí)間始點(diǎn). 例子: 結(jié)果: 11/4/99 3:34:45 PM 其中 "m" = "month"; "d" = "day"; 如果是currentDate 格式,則, "h" = "hour"; "s" = "second";
??
??7. #.函數(shù)Datediff() 功能:計(jì)算某量個(gè)指定的時(shí)間差 格式:datediff(timeinterval,date1,date2[,firstdayofweek[,firstdayofyear>) 參數(shù):timeinterval 是時(shí)間單位; date1,date2是有效的日期表達(dá)式,firstdayofweek,firstdayofyear 是任意選項(xiàng). 例子: 結(jié)果:There are 150 days to millenium from 8/4/99.
??
??8. #.函數(shù)day() 功能:返回一個(gè)整數(shù)值,對(duì)應(yīng)于某月的某日 格式:day(date) 參數(shù):date是一個(gè)有效的日期表達(dá)式; 例子lt;% =date(#8/4/99#) %> 結(jié)果:4
??
??
??9. #.函數(shù)formatcurrency() 功能:轉(zhuǎn)換成貨幣格式 格式:formatcurrency(expression [,digit[,leadingdigit[,paren[,groupdigit>>) 參數(shù):expression 是有效的數(shù)字表達(dá)式;digit表示小數(shù)點(diǎn)后的位數(shù);leadingdigit,paren,groupdigit是任意選項(xiàng). 例子lt;%=FormatCurrency(34.3456)%> 結(jié)果34.35
??10. #.函數(shù)Formatdatetime() 功能:格式化日期表達(dá)式/變量 格式:formatdatetime(date[,nameformat]) 參數(shù):date為有效的日期表達(dá)式/變量;nameformat是指定的日期格式常量名稱. 例子lt;% =formatdatetime("08/04/99",vblongdate) %> 結(jié)果:Wednesday,August 04,1999
??
??11. #.函數(shù)Isnumeric() 功能:返回一個(gè)布爾值,判斷變量是否為數(shù)字變量,或者是可以轉(zhuǎn)換成數(shù)字的其它變量. 格式:isnumeric(expression) 參數(shù):expression 是任意的變量. 例子: 結(jié)果: true.
??
??12. #.函數(shù)Isobject() 功能:返回一個(gè)布爾值,判斷變量是否為對(duì)象的變量, 格式:isobject(expression) 參數(shù):expression 是任意的變量. 例子: 結(jié)果: true
??
??
??13. #.函數(shù):Lbound() 功能:返回一個(gè)數(shù)組的下界. 格式:Lbound(arrayname[,dimension]) 參數(shù):arrayname 是數(shù)組變量,dimension 是任意項(xiàng) 例子: 結(jié)果:0
??
??14. #.函數(shù)Lcase() 功能:將一字符類型變量的字符全部變換小寫字符. 格式:Lcase(string) 參數(shù):string是字符串變量 例子: 結(jié)果:this is lcase!
??
??
??15. #.函數(shù)left() 功能:截取一個(gè)字符串的前部分; 格式:left(string,length) 參數(shù):string字符串,length截取的長(zhǎng)度. 例子: 結(jié)果:this i
??
??16. #.函數(shù)len() 功能:返回字符串長(zhǎng)度或者變量的字節(jié)長(zhǎng)度 格式:len(string |varname) 參數(shù):string字符串;varname任意的變量名稱 例子: 結(jié)果:15
??
??
??17. #.函數(shù)ltrim() 功能:去掉字符串前的空格. 格式:ltrim(string) 參數(shù):string 字符串. 例子: 結(jié)果:Today
??
??
??19. #.函數(shù)minute() 功能:返回一數(shù)值, 表示分鐘 格式:minute(time) 參數(shù): time是時(shí)間變量 例子lt;% =minute(#12:23:34#) %> 結(jié)果:23
??
??20. #.函數(shù)month() 功能:返回一數(shù)值, 表示月份 格式:month(time) 參數(shù):time是日期變量 例子lt;% =month(#08/09/99) %> 結(jié)果:9
??
??
??21. #.函數(shù)monthname() 功能:返回月份的字符串(名稱). 格式:Monthname(date [,abb]) 參數(shù):date是日期變量,abb=true時(shí) 則月份的縮寫, 例子: 結(jié)果:April
??
??22. #.函數(shù)Now() 功能:返回系統(tǒng)的當(dāng)前時(shí)間和日期. 格式:now() 參數(shù):無(wú) 例子: 結(jié)果: 05/10/00 8:45:32 pm
??
??
??23. #.函數(shù):replace() 功能:在字符串中查找,替代指定的字符串. 格式:replace(strtobesearched,strsearchfor,strreplacewith [,start[,count[,compare>]) 參數(shù):strtobesearched是字符串; strsearchfor是被查找的子字符串;strreplacewith 是用來(lái)替代的子字符串.start,count,compare 是任意選項(xiàng). 例子: 結(jié)果:this is an orange.
??
??24. #.函數(shù)right() 功能:截取一個(gè)字符串的后部分 格式:right(string,length) 參數(shù):string字符串,length截取的長(zhǎng)度. 例子: 結(jié)果:st!
??
??
??25. #.函數(shù)rnd() 功能:返回一個(gè)隨機(jī)數(shù)值 格式:rnd[(number)] 參數(shù):number是任意數(shù)值. 例子: 結(jié)果:0/1數(shù)值之一,無(wú)randomize(), 則不能產(chǎn)生隨機(jī)數(shù).
??
??26. #.函數(shù)round() 功能:完整數(shù)值 格式:round(expression[,numright]) 參數(shù):expression數(shù)字表達(dá)式;numright任意選項(xiàng). 例子: 結(jié)果: 12
??
??
??27. #.函數(shù)rtrim() 功能:去掉字符串后的空格. 格式:rtrim(string) 參數(shù):string 是字符串 例子: 結(jié)果:this is a test!
??
??28. #.函數(shù)second() 功能:返回一個(gè)整數(shù)值. 格式:second(time) 參數(shù):time是一個(gè)有效的時(shí)間表達(dá)式; 例子lt;% =second(# 12:28:30#) %> 結(jié)果:30
??
??
??29. #.函數(shù)strReverse() 功能:返回與原字符串排列逆向的字符串. 格式:strreverse(string) 參數(shù):string是字符串 例子lt;% =strreverse("this is a test!") 結(jié)果:!tset a si siht
??
??30. #.函數(shù)time() 功能:返回當(dāng)前系統(tǒng)的時(shí)間值. 格式:time() 參數(shù):無(wú) 結(jié)果:9:58:28 Am 關(guān)鍵詞:ASP
??
??
??31. #.函數(shù)trim() 功能:刪去字符串前,后的空格. 格式:trim(string) 參數(shù):string 字符串. 例子: 結(jié)果:this is a test!
??
??32. #.函數(shù)UBound() 功能:返回一個(gè)數(shù)組的上界. 格式:Ubound(expression [,dimension]) 參數(shù):expression 是數(shù)組表達(dá)式/數(shù)組變量,dimension 是任意項(xiàng) 例子: 結(jié)果: 2
??
??
??33. #.函數(shù):UCase() 功能:將一字符類型變量的字符全部變換成大寫字符. 格式:Ucase(string) 參數(shù):string是字符串變量 例子: 結(jié)果:THIS IS LCASE!
??
??34. #.函數(shù)Vartype() 功能:返回變量的常量代碼(整數(shù)) 格式:Vartype(varname) 參數(shù):varname是任何類型的變量名稱. 例子: 結(jié)果:2 (2表示整數(shù),須要參考ASP常量代碼.)
??
??
??35. #.函數(shù)Weekday() 功能:返回一個(gè)整數(shù),對(duì)應(yīng)一周中的第幾天. 格式:Weekday(date [,firstofweek]) 參數(shù):date為日期變量,firstofweek為任選項(xiàng). 例子: 結(jié)果:3(3 表示是星期二)
??
??36. #.函數(shù)weekdayname() 功能:返回字符串,對(duì)應(yīng)星期幾. 格式:weekdayname(weekday[,abb[,firstdayofweek>) 參數(shù):weekday為日期變量,abb,firstdayofweek為任選項(xiàng). 例子: 結(jié)果: Wednesday
??
??
??37. #.函數(shù)year() 功能:返回日期表達(dá)式所在的年份. 格式:year(date) 參數(shù):date是有效的日期表達(dá)式 例子: 結(jié)果:1999

  • sql server補(bǔ)丁
  • sqlserver
  • 黑客軟件合輯
sql server補(bǔ)丁
(9)sql server補(bǔ)丁

sql server補(bǔ)丁主要是關(guān)于安全性與兼容性兩方面,這里為您提供的是sql server補(bǔ)丁大全,包括所有版本的各種功能的補(bǔ)丁。

...更多>>
sqlserver
(64)sqlserver

sqlserver美國(guó)Microsoft公司推出的一種關(guān)系型數(shù)據(jù)庫(kù)系統(tǒng),現(xiàn)在大部份數(shù)據(jù)庫(kù)都是sql,這里為您提供的是sqlserver的各種版本,以及sql的教程,絕對(duì)是當(dāng)前最好用的,每個(gè)版本我們都通過(guò)了完整的測(cè)試。

...更多>>
黑客軟件合輯
(45)黑客軟件合輯

黑客軟件是指那些用于黑客攻防的軟件,一般都有很多分類,比較著名的有灰鴿子、網(wǎng)絡(luò)刺客等。本站收集了一些黑客紅客類軟件,包括各種注入工具、封包攔截工具和鍵盤記錄軟件,可以用來(lái)進(jìn)行SQL注入、DDOS攻擊、以及遠(yuǎn)程控制等。這些軟件僅限測(cè)試及學(xué)習(xí)使用,請(qǐng)勿用于非法用途!

...更多>>

擴(kuò)展知識(shí)

相關(guān)評(píng)論

閱讀本文后您有什么感想? 已有 人給出評(píng)價(jià)!

  • 2791 喜歡喜歡
  • 2101 頂
  • 800 難過(guò)難過(guò)
  • 1219 囧
  • 4049 圍觀圍觀
  • 5602 無(wú)聊無(wú)聊
熱門評(píng)論
最新評(píng)論
發(fā)表評(píng)論 查看所有評(píng)論(0)
昵稱:
表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
字?jǐn)?shù): 0/500 (您的評(píng)論需要經(jīng)過(guò)審核才能顯示)
主站蜘蛛池模板: 精品九九久久国内精品 | 国产免费播放一区二区三区 | 开心婷婷激情五月 | 一级毛片免费视频 | 色爱五月天 | 久久精品中文字幕一区 | 国内精品免费一区二区三区 | 欧美日韩中文亚洲另类春色 | 国产成人艳妇aa视频在线 | 97在线观看中心 | 久久久久久久网 | 过春天在线观看完整版免费 | 成人在线视频网址 | 国产婷婷色综合成人精品 | 求av网站 | 黄色在线观看www | 国产精品第九页 | 第四色网址 | 狠狠色婷婷七月色综合 | 国产亚洲欧美视频 | 九九九九九九精品免费 | 久久精品国产69国产精品亚洲 | 免费在线亚洲视频 | 玖玖中文 | 国产亚洲欧美久久精品 | 外国人性视频 | 久久高清免费 | 99九九精品视频 | 99ri视频 | 免费人成毛片动漫在线播放 | 国内精品区一区二区三 | 国产精品视频网站你懂得 | 精品欧美一区二区在线观看 | 久久精品国产99久久无毒不卡 | 国产精品九九 | 99精品视频在线观看免费播放 | 国产男女 爽爽爽爽视频 | 久操色| 精品欧美一区二区三区精品久久 | 亚洲综合激情九月婷婷 | 伊人网在线视频 |