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 SQL_Boolean
Chức năng: Điều chỉnh lổi logic của câu lệnh SQL
Ngôn ngữ: asp - Nhóm: database
CÚ PHÁP
 boolean = SQL_Boolean(expression, defaultvalue, databasetype)

Đối số:
expression:
"yes", "on", "true", "True", "-1", "1" -> True
"no", "off", "false", "False", "0" -> False
databasetype: MSAccess, MSSQL, MySQL, Oracle

VÍ DỤ
<% 
  dim a 
   
    a = SQL_Boolean("on", 0, "MSAccess") 
  '--- returns -1 
   
    a = SQL_Boolean("yes", 0, "MySQL") 
  '--- returns 1 
   
    a = SQL_Boolean("yes", 0, "MSSQL") 
  '--- returns 1 
   
    a = SQL_Boolean("yes", 0, "Oracle") 
  '--- returns 1 
%> 
ASP Code
<% 
  Public Function SQL_boolean(ByVal abExpression, ByRef abDefault, ByRef DbType) 
      '--- Declare Database  Constants 
      Dim lbTrue, lbFalse 
      If LCASE(dbType) = "msaccess" Then 
          lbTRUE = -1  '--- (-1 = MSAccess) 
      Else 
          lbTRUE = 1 '--- (1 = SQL) 
      End if 
          lbFALSE = 0 
      Dim lbResult '---  Result to be passed back 
      '--- Prepare for any  errors that may occur 
      On Error Resume Next 
      '--- If expression not  provided 
      If abExpression = "" Then 
          '---  Set expression to default value 
          abExpression = abDefault 
      End If '--- abExpression =  "" 
      '--- Attempt to convert  expression 
      lbResult = CBool(abExpression) 
      '--- If Err Occured 
      If Err Then 
          '---  Clear the error 
          Err.Clear 
          '---  Determine action based on Expression 
          Select Case LCase(abExpression) 
              '--- True expressions 
              Case "yes", "on", "true", "True", "-1", "1" 
                  lbResult = True 
              '--- False expressions 
              Case "no", "off", "false", "False", "0" 
                  lbResult = False 
              '--- Unknown expression 
              Case Else 
                  lbResult = abDefault 
          End Select '---  LCase(abExpression) 
      End If ' Err 
      '--- If result is True 
      If lbResult Then 
          '---  Return True 
          SQL_boolean = lbTRUE 
      '--- Else Result is  false 
      Else 
          '---  Return False 
          SQL_boolean = lbFALSE 
      End If '--- lbResult 
  End Function '--- SQL_boolean 
%> 

CompactDB
DateDB
EscapeApos
EscapeBit
EscapeDate
EscapeInt
MkDatabase
NoSQLInjection
Procedures
RecordCount
Library ›› HTML Tag | PHP Function | ASP Function
Page : 806888
Online :
Visited : 370211
 
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 |