如果表orders裡沒有任何一條符合記錄。那麼如果只用if(rs.eof) then判斷會導致錯誤。正確做法是頭指標尾指標都要判斷:if(rs.bof and check.eof) then正確代碼如下: set check=server.CreateObject("adodb.recordset") check.open "select username from orders where
網上有很多類似的文章,但多數是一大堆代碼。其實ASP有內建的處理Unicode的函數,很簡單的幾句代碼就可以完成轉化: 推薦指數:★★★★☆ '將漢字轉化為unicode (不支援第二平面漢字,但幾乎極少有人能夠使用到這些漢字) Function getUnicode(hanzi) Dim str str = Left(hanzi,1) '當然這裡需要判斷hanzi是一個字元,如果需要多個字元請使用迴圈 if Len(str)>0 then
dim conn dim connstr on error resume next connstr="DBQ="+server.mappath("data/userinfo.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" set conn=server.createobject("ADODB.CONNECTION") if err
'************************************* '防XSS注入函數 更新於2009-04-21 by evio '與checkstr()相比, checkxss更加安全 '************************************* Function Checkxss(byVal ChkStr) Dim Str
<% OPTION EXPLICIT const BASE_64_MAP_INIT = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" dim nl ' zero based arrays dim Base64EncMap(63) dim Base64DecMap(127) ' must be called before using anything else
<% function decrypt(dcode) dim texts dim i for i=1 to len(dcode) texts=texts & chr(asc(mid(dcode,i,2))-i) next decrypt=texts end function function encrypt(ecode) dim texts dim i for i=1 to len(ecode) texts=texts &
'把標準時間轉換為UNIX時間戳記 Function ToUnixTime(strTime, intTimeZone) If IsEmpty(strTime) or Not IsDate(strTime) Then strTime = Now If IsEmpty(intTimeZone) or Not isNumeric(intTimeZone)
誰能詳細解釋asp中"if not rs.eof and not rs.bof then"怎麼理解? 2007-06-10 21:11 zhbxj2002 | 分類:其他程式設計語言 | 瀏覽4349次 誰能詳細解釋asp中"if not rs.eof and not rs.bof then"怎麼理解?