隐藏执行时间
Sub s__HideTimeOver()
Dim tTimeOver
tTimeOver = FormatNumber((Timer() - tStartTime) * 1000, 3, true)
response.Write(vbCrLf & "<!--执行时间: " & tTimeOver & " 毫秒-->")
End Sub
打开数据库连接
function f__OpenConn()
Dim connstr
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
connstr = connstr & Server.MapPath(GBL__STR_DB_PATH)
Set conn = Server.CreateObject("Adodb.Connection")
conn.open connstr
End function
关闭数据库连接
function f__CloseConn()
If IsObject(conn) Then
Set conn = nothing
End If
End function
HTML 转换
function toHtml(str)
Dim Result
Result = str & ""
Result = replace(Result, ">", ">")
Result = replace(Result, "<", "<")
Result = replace(Result, " ", " ")
Result = replace(Result, """", """)
Result = replace(Result, CHR(13), "")
Result = replace(Result, CHR(10), "<br>")
Result = replace(Result, CHR(39), "'")
toHtml = Result
End function
长整数转换
function toLng(strNum, Default)
Dim Result
If strNum <> "" And IsNumeric(strNum) Then
Result = CLng(strNum)
Else
toNum = Default
End If
toLng = Result
End function
货币类型转换
function toCur(strNum, Default)
Dim Result
If strNum <> "" And IsNumeric(strNum) Then
Result = CCur(strNum)
Else
toNum = Default
End If
toCur = Result
End function
SQL 替换编码
function toSqlr(str)
str = str & ""
str = replace(str, "'", "")
str = replace(str, """", "")
toSqlr = str
End function
SQL 编码
function toSql(str)
str = str & ""
str = replace(str, "'", "''")
toSql = str
End function
转换数字为固定位数, 不足位补0
function ConvertNumber(strNum)
strNum = strNum & ""
Dim iLen, iMaxL, iLdiv, Result
iLen = Len(strNum)
iMaxL = 8
iLdiv = iMaxL - iLen
Result = string(iLdiv, "0") & strNum
ConvertNumber = Result
End function
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |