วิธีการที่ใช้ในฐานข้อมูลการเข้าถึง:
Instr (','+Specialty+',', ',', ', 2,') <> 0
รหัสที่สมบูรณ์มีดังนี้:
functionupdate08 () dimtemplatefilepath
TemplateFilePath = Server.mappath ("../../../ default.htm")
dimtclass, strhtml
settClass = newTKL_TEMPLATECLASS
strhtml = ""
dimrs, sql
sql = "selecttop8title, filepath, addtimefromview_newsinfowhereinstr (','+พิเศษ+',', ', 18,')
setRs = conn.execute (SQL)
whilenotrs.eof
strhtml = strhtml & "· [" & strclass.formatmydate (rs ("addtime"), "{m}/{d}") & "] <ahref =" "& rs (" filepath ") &" "target =" "" "
Rs.Movenext
ใช้
Rs.close
setrs = ไม่มีอะไร
มีคลาส
.Opentemplate (TemplateFilePath)
.StartElement = "<!-downrecommand: เริ่ม->"
.ENDELEMENT = "<!
.value = strhtml
. Replacetemplate ()
.บันทึก()
จบลงด้วย
settClass = ไม่มีอะไร
endfunction
หากย่อหน้านี้ใช้ใน SQL มันจะแจ้งว่า 'Instr' ไม่ใช่ชื่อฟังก์ชั่นที่เป็นที่รู้จัก
แอปพลิเคชันอัพเดตฐานข้อมูล SQL:
dbo.isspeciality (พิเศษ, '2')> 0
รหัสที่สมบูรณ์มีดังนี้:
'// Download Center - แนะนำ functionupdate08 ()
dimtemplatefilepath
TemplateFilePath = Server.mappath ("../../../ default.htm")
dimtclass, strhtml
settClass = newTKL_TEMPLATECLASS
strhtml = ""
dimrs, sql
sql = "selecttop8title, filepath, addtimefromview_newsinfowheredbo.isspeciality (Specialty, '18 ')> 0OrderByIdDedesc"
setRs = conn.execute (SQL)
whilenotrs.eof
strhtml = strhtml & "· [" & strclass.formatmydate (rs ("addtime"), "{m}/{d}") & "] <ahref =" "& rs (" filepath ") &" "target =" "" "
Rs.Movenext
ใช้
Rs.close
setrs = ไม่มีอะไร