張貼日期:Mar 09, 2010 9:12:54 AM
<%
'除錯程式
Function myDebug(switch)
If switch = "On" Then
Response.Write("SQLString--> "& SQLString & "<BR>")
Response.Write("Err.Number--> "& Err.Number & "<BR>")
Response.Write("Err.Description--> "& Err.Description & "<BR>")
Response.Write("Err.Source--> "& Err.Source & "<BR>")
Response.Write("Err.Line--> "& Err.Line & "<BR>")
Err.Clear
End If
End Function
'取代vbCrLf換行
Function Crlf2br(str)
If Not IsNull(str) Then
Crlf2br = Replace(str, vbCrLf ,"<BR>")
End If
End Function
'資料型態處理
Function fixData(myData, DataType)
fixData = Trim(myData)
Select Case DataType
'字串
Case "S"
If fixData = "" OR IsNull(fixData) Then
fixData = "Null"
Else
fixData = "'" & Replace(fixData, "'", "''") & "'"
End If
'數值
Case "N"
If fixData = "" OR Not IsNumeric(fixData) Then
fixData = "Null"
End If
'日期
Case "D"
If fixData = "" OR IsNull(fixData) Then
fixData = "Null"
Else
fixData = "#" & fixData & "#"
End If
End Select
End Function
' 秀出警告視窗
Sub myAlert(Str)
Response.Write("<script language='JavaScript'>")
Response.Write("alert('" & Str& "');")
Response.Write("</script>")
End Sub
' 回上一頁
Sub myWinBack()
Response.Write("<script language='JavaScript'>")
Response.Write("history.go(-1);")
Response.Write("</script>")
Response.End()
End Sub
' 關閉視窗
Sub myWinClose()
Response.Write("<script language='JavaScript'>")
Response.Write("window.close();")
Response.Write("</script>")
Response.End()
End Sub
' 到指定頁面
Sub myParentWinGo(Url)
Response.Write("<script language='JavaScript'>")
Response.Write("parent.location.href = '" & Url& "';")
Response.Write("</script>")
Response.End()
End Sub
' 到指定頁面
Sub myWinGo(Url)
Response.Write("<script language='JavaScript'>")
Response.Write("self.location.href = '" & Url& "';")
Response.Write("</script>")
Response.End()
End Sub
' 問啟視窗頁面
Sub myopenWin(Url)
Response.Write("<script language='JavaScript'>")
Response.Write("window('" & Url& "','','menubar=no,status=yes,scrollbars=yes,top=200,left=200,toolbar=no,width=960,height=710');")
Response.Write("</script>")
Response.End()
End Sub
%>