- ·上一篇文章:运用ASP调用数据库中视图及存储过程
- ·下一篇文章:ASP+SQLServer2000 经验积累
ASP函数库
dd
Format_Time = y & m & d
Case 6
'mm/dd
Format_Time = m & "/" & d
case 7
Format_Time = m & "/" & d & "/" & right(y,2)
End Select
End Function
'**************************************************
'函数ID:0036[测试数据库是否存在]
'函数名:TestDBOK
'作 用:测试数据库是否存在
'参 数:TestConnStr ---- 数据库链接字串
'返回值:测试成功返回 True 否则 False
'示 例:TestDBOK("testConnString")
'**************************************************
Public Function TestDBOK(ByVal TestConnStr)
TestDBOK=False
DIM fu_Conn
Set fu_Conn=server.createobject("ADODB.Connection")
On Error GoTo 0
On Error Resume Next
fu_Conn.open TestConnStr
If Err.Number = 0 Then
TestDBOK=True
End If
On Error GoTo 0
Set fu_Conn = Nothing
End Function
'**************************************************
'函数ID:0037[测试数据库中的表是否存在]
'函数名:TestTbOK
'作 用:测试数据库中的表是否存在
'参 数:ObjConnName ---- 数据库链接定义
'参 数:TestDbname ---- 被测试表的名称
'返回值:测试成功返回 True 否则 False
'示 例:TestTbOK(TestConn,"tbname")
'**************************************************
Public Function TestTbOK(ByVal ObjConnName,ByVal TestDbname)
TestTbOK=False
DIM fu_Rs
Set fu_Rs=server.createobject("ADODB.Recordset")
On Error GoTo 0
On Error Resume Next
fu_Rs.open "SELECT * FROM "&TestDbname,ObjConnName,1,1
fu_Rs.Close
If Err.Number = 0 Then
TestTbOK=True
End If
On Error GoTo 0
Set fu_Rs = Nothing
End Function
'**************************************************
'函数ID:0038[在线HTML编辑器]
'函数名:HTML_MZYEDIT
'作 用:测试数据库中的表是否存在
'参 数:MEIPath ---- 各图标图像所在的路径
'参 数:GtimgPath ---- 图片上传程序的URL
'参 数:GtswfPath ---- Flash动画上传程序的URL
'参 数:GtwavPath ---- 音乐文件上传程序的URL
'参 数:GtotherPath ---- 其他文件上传程序的URL
'返回值:HTML编辑器
'示 例:
'**************************************************
Public Function HTML_MZYEDIT(ByVal MEIPath,ByVal GtimgPath,ByVal GtswfPath,ByVal GtwavPath,ByVal GtotherPath)
Response.Write "<!--BEGIN 史上最小的在线HTML编辑器,开发者:马政永,版本1.0 网站:http://www.lovemycn.com,本软件为授权使用,如没有马政永授权,任何人或单位不得使用,否则将已侵犯知识产权罪论处!-->" & vbCrlf
Response.Write "<style>img{border: 1 solid #DFDED2;}</style>" & vbCrlf
Response.Write "<table onConTextMenu ='event.returnValue=false;' style='"">宋体; font-size: 9pt;cursor:default;width:100%;height:100%;' bgcolor='#DFDED2'><tr><td style='width:100%;height:0%;'>" & vbCrlf
Response.Write "<IMG BORDER='0' ALT='撤消' SRC='"&MEIPath&"undo.gif' NAME='Undo' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='恢复' SRC='"&MEIPath&"redo.gif' NAME='Redo' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='剪切' SRC='"&MEIPath&"cut.gif' NAME='Cut' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='拷贝' SRC='"&MEIPath&"copy.gif' NAME='Copy' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='粘贴' SRC='"&MEIPath&"paste.gif' NAME='Paste' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='删除' SRC='"&MEIPath&"delete.gif' NAME='Delete' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='距左' SRC='"&MEIPath&"aleft.gif' NAME='JustifyLeft' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='距中' SRC='"&MEIPath&"center.gif' NAME='JustifyCenter' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='距右' SRC='"&MEIPath&"aright.gif' NAME='JustifyRight' > " & vbCrlf
Response.Write "<IMG BORDER='0' SRC='"&MEIPath&"fgs.gif'> " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='加粗' SRC='"&MEIPath&"bold.gif' NAME='Bold' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='斜体' SRC='"&MEIPath&"italic.gif' NAME='Italic' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='下划线' SRC='"&MEIPath&"underline.gif' NAME='Underline' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='超链' SRC='"&MEIPath&"wlink.gif' NAME='CreateLink' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='取消超链' SRC='"&MEIPath&"uwlink.gif' NAME='Unlink' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='取消格式' SRC='"&MEIPath&"untype.gif' NAME='RemoveFormat' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='水平线' SRC='"&MEIPath&"hr.gif' NAME='InsertHorizontalRule' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='缩进' SRC='"&MEIPath&"indent.gif' NAME='Indent' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='取消缩进' SRC='"&MEIPath&"outdent.gif' NAME='Outdent' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='数字标识' SRC='"&MEIPath&"numlist.gif' NAME='InsertOrderedList' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='点标识' SRC='"&MEIPath&"bullist.gif' NAME='InsertUnorderedList' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='加入图片' SRC='"&MEIPath&"img.gif' NAME='InsertImage' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='加入FLASH' SRC='"&MEIPath&"intole.gif' NAME='Inputother' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='加入影音文件' SRC='"&MEIPath&"play.gif' NAME='Inputother' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='加入文件链接' SRC='"&MEIPath&"otlin.gif' NAME='Inputother' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='插入Excel工作表' SRC='"&MEIPath&"excel.gif' NAME='excel' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='去除
Format_Time = y & m & d
Case 6
'mm/dd
Format_Time = m & "/" & d
case 7
Format_Time = m & "/" & d & "/" & right(y,2)
End Select
End Function
'**************************************************
'函数ID:0036[测试数据库是否存在]
'函数名:TestDBOK
'作 用:测试数据库是否存在
'参 数:TestConnStr ---- 数据库链接字串
'返回值:测试成功返回 True 否则 False
'示 例:TestDBOK("testConnString")
'**************************************************
Public Function TestDBOK(ByVal TestConnStr)
TestDBOK=False
DIM fu_Conn
Set fu_Conn=server.createobject("ADODB.Connection")
On Error GoTo 0
On Error Resume Next
fu_Conn.open TestConnStr
If Err.Number = 0 Then
TestDBOK=True
End If
On Error GoTo 0
Set fu_Conn = Nothing
End Function
'**************************************************
'函数ID:0037[测试数据库中的表是否存在]
'函数名:TestTbOK
'作 用:测试数据库中的表是否存在
'参 数:ObjConnName ---- 数据库链接定义
'参 数:TestDbname ---- 被测试表的名称
'返回值:测试成功返回 True 否则 False
'示 例:TestTbOK(TestConn,"tbname")
'**************************************************
Public Function TestTbOK(ByVal ObjConnName,ByVal TestDbname)
TestTbOK=False
DIM fu_Rs
Set fu_Rs=server.createobject("ADODB.Recordset")
On Error GoTo 0
On Error Resume Next
fu_Rs.open "SELECT * FROM "&TestDbname,ObjConnName,1,1
fu_Rs.Close
If Err.Number = 0 Then
TestTbOK=True
End If
On Error GoTo 0
Set fu_Rs = Nothing
End Function
'**************************************************
'函数ID:0038[在线HTML编辑器]
'函数名:HTML_MZYEDIT
'作 用:测试数据库中的表是否存在
'参 数:MEIPath ---- 各图标图像所在的路径
'参 数:GtimgPath ---- 图片上传程序的URL
'参 数:GtswfPath ---- Flash动画上传程序的URL
'参 数:GtwavPath ---- 音乐文件上传程序的URL
'参 数:GtotherPath ---- 其他文件上传程序的URL
'返回值:HTML编辑器
'示 例:
'**************************************************
Public Function HTML_MZYEDIT(ByVal MEIPath,ByVal GtimgPath,ByVal GtswfPath,ByVal GtwavPath,ByVal GtotherPath)
Response.Write "<!--BEGIN 史上最小的在线HTML编辑器,开发者:马政永,版本1.0 网站:http://www.lovemycn.com,本软件为授权使用,如没有马政永授权,任何人或单位不得使用,否则将已侵犯知识产权罪论处!-->" & vbCrlf
Response.Write "<style>img{border: 1 solid #DFDED2;}</style>" & vbCrlf
Response.Write "<table onConTextMenu ='event.returnValue=false;' style='"">宋体; font-size: 9pt;cursor:default;width:100%;height:100%;' bgcolor='#DFDED2'><tr><td style='width:100%;height:0%;'>" & vbCrlf
Response.Write "<IMG BORDER='0' ALT='撤消' SRC='"&MEIPath&"undo.gif' NAME='Undo' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='恢复' SRC='"&MEIPath&"redo.gif' NAME='Redo' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='剪切' SRC='"&MEIPath&"cut.gif' NAME='Cut' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='拷贝' SRC='"&MEIPath&"copy.gif' NAME='Copy' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='粘贴' SRC='"&MEIPath&"paste.gif' NAME='Paste' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='删除' SRC='"&MEIPath&"delete.gif' NAME='Delete' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='距左' SRC='"&MEIPath&"aleft.gif' NAME='JustifyLeft' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='距中' SRC='"&MEIPath&"center.gif' NAME='JustifyCenter' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='距右' SRC='"&MEIPath&"aright.gif' NAME='JustifyRight' > " & vbCrlf
Response.Write "<IMG BORDER='0' SRC='"&MEIPath&"fgs.gif'> " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='加粗' SRC='"&MEIPath&"bold.gif' NAME='Bold' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='斜体' SRC='"&MEIPath&"italic.gif' NAME='Italic' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='下划线' SRC='"&MEIPath&"underline.gif' NAME='Underline' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='超链' SRC='"&MEIPath&"wlink.gif' NAME='CreateLink' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='取消超链' SRC='"&MEIPath&"uwlink.gif' NAME='Unlink' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='取消格式' SRC='"&MEIPath&"untype.gif' NAME='RemoveFormat' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='水平线' SRC='"&MEIPath&"hr.gif' NAME='InsertHorizontalRule' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='缩进' SRC='"&MEIPath&"indent.gif' NAME='Indent' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='取消缩进' SRC='"&MEIPath&"outdent.gif' NAME='Outdent' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='数字标识' SRC='"&MEIPath&"numlist.gif' NAME='InsertOrderedList' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='点标识' SRC='"&MEIPath&"bullist.gif' NAME='InsertUnorderedList' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='加入图片' SRC='"&MEIPath&"img.gif' NAME='InsertImage' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='加入FLASH' SRC='"&MEIPath&"intole.gif' NAME='Inputother' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='加入影音文件' SRC='"&MEIPath&"play.gif' NAME='Inputother' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='加入文件链接' SRC='"&MEIPath&"otlin.gif' NAME='Inputother' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='插入Excel工作表' SRC='"&MEIPath&"excel.gif' NAME='excel' > " & vbCrlf
Response.Write "<IMG BORDER='0' ALT='去除
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] 下一页

