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_Currency
Chức năng: Chuẩn bị giá trị cho câu lệnh SQL
Ngôn ngữ: asp - Nhóm: database
CÚ PHÁP
  currency = SQL_Currency(currencyvalue, databasetype) 

Hàm SQL_Currency chuẩn bị giá trị số cho câu lệnh SQL

VÍ DỤ
<%
  Dim a
    a = SQL_Currency("20,15", "MSAccess") '--- MSAccess,  MySQL, Oracle
  '--- returns 20,15 as currency
  
    a = SQL_Currency("20,15", "MSSQL")
  '--- returns CONVERT(MONEY, '" &  Replace("20,15", ",", ".") & "', 0)
%> 
ASP Code
<%
  Public Function SQL_currency(ByRef acExpression, ByRef DbType)
      acExpression = Replace(acExpression, ",", ".")
      '--- If Empty  Expression
      If acExpression = "" Then
          '---  Return Null
          SQL_currency = "NULL"
      '--- Else expression  has content
      Else
          '---  Prepare for Errors
          On Error Resume Next
          '---  Attempt to convert expression to currency
          If LCase(DbType) = "mssql" Then
              SQL_currency = "CONVERT(MONEY, '" & Replace(acExpression, ",", ".") & "',  0)" '---  MSSQL Database
              '--- alternative method: CAST('" &  request.form(Field) & "' AS MONEY)
          Else
              SQL_currency = acExpression
          End If
          '---  If error occured
          If Err Then
              '--- Clear Error
              Err.Clear
              SQL_currency = "NULL"
          End If '--- Err
      End If '--- acExpression =  ""
  End Function '--- SQL_currency
%> 

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