World Of Webmaster
Đăng nhập / Đăng ký
Account
Free for web
Check pagerank
Input check pager (Not http://)

Ext: blog.kai.vn
Check google pagerank
View HTML source
FUNCTION LIBRARY
HTML Tags Library
PHP Functions Library ASP Functions Library
ASP Functions EscapeDate
Chức năng: Chuyển đổi biến ngày tháng cho sql server
Ngôn ngữ: asp - Nhóm: database
CÚ PHÁP
  escapedString = EscapeDate(variantDate) 

Chuyển đổi thành giá trị ngày tháng chuẩn dùng trong SQL server. Nếu giá trị input không hợp chuẩn, giá trị null được trả về hoặc trả về giá trị giữa dấu nháy '1/1/2001'.

VÍ DỤ
<%
  dim dDate, sql
  
    dDate = now
  
      sql = "select * from table  where date_field between '1/1/01' and " & escapedate(dDate)
%> 
ASP Code
<%
  function escapedate(byval sInput)
      if isnull(sInput) then
          escapedate = "null"
          exit function
      end if
      if len(trim(sInput)) = 0 then
          escapedate = "null"
          exit function
      end if
      if not isdate(sInput) then
          escapedate = "null"
          exit function
      end if
      escapedate = "'" & replace(formatdatetime(sInput, 2), "'", "''") & "'"
  end function
%> 

CompactDB
DateDB
EscapeApos
EscapeBit
EscapeInt
MkDatabase
NoSQLInjection
Procedures
RecordCount
RecordCount2
Library ›› HTML Tag | PHP Function | ASP Function
Page : 806805
Online :
Visited : 370128
 
Liên h | Thêm vào Favorite | Gửi link qua e-mail | Thông tin website
Copright © 2009 KAI Blog
Code by BOINGOnline. Contact email : contact@kai.vn
Theme: default | classic |