Chức năng: Chuyển đổi biến số cho SQL server
Ngôn ngữ: asp - Nhóm: database
CÚ PHÁP
escapedString = EscapeInt(variant)
Chuyển đổi ngày tháng theo chuẩn dùng trong SQL server. Nếu giá trị input là null hoặc false hoặc không phải là số. Hàm trả về giá trị null hoặc giá trị input.
VÍ DỤ
<%
dim dblItemCount, sql
dblItemCount = 3.212
sql = "select * from table where double_field > " & escapeint(dblItemCount)
%>
ASP Code
<%
function escapeint(byval sInput)
if isnull(sInput) then
escapeint = "null"
exit function
end if
if len(trim(sInput)) = 0 then
escapeint = "null"
exit function
end if
sInput = replace(sInput, ",", "")
if not isnumeric(sInput) then
escapeint = "null"
exit function
end if
escapeint = sInput
end function
%>