hx_conndatabase.asp

来自「带OA办公的动态源码网站」· ASP 代码 · 共 50 行

ASP
50
字号
<!--#INCLUDE FILE="HX_CONSTSTR.ASP"-->
<!--#include file="HX_SYSTEM.ASP"-->
<!--#INCLUDE FILE="datapath.ASP"-->
<!--#INCLUDE FILE="HX_CHECKEMAIL.ASP"-->
<!--#INCLUDE FILE="HX_FUNCTION.ASP"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
Function HX_Checknum(Numstr)
if isnull(Numstr) or Numstr=""  then
exit Function
else
if not isnumeric(Numstr) then
response.write"<center>非法操作导致程序中止!</center>"
response.end
else
HX_Checknum=int(Numstr)
end if
end if
End Function
Function HX_GoBack(Msgstr,url)
 If url<>"" and Msgstr<>"" Then
   response.Write("<script language=javascript>alert('"&Msgstr&"');location.href='"&url&"';</script>")
   response.end
 elseIf url="" and Msgstr<>"" Then
   response.Write("<script language=javascript>alert('"&Msgstr&"');history.go(-1);</script>")
   response.end
 else
   response.Write("<script language=javascript>window.close();</script>")
   response.end
 end if  
End Function

Function HX_Conn(Directory)'取得数据库对象
  on error resume next
  SET CONN=Server.CreateObject("ADODB.Connection")
  CONNSTR="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&WS_DB.DBPathAddress(Directory)
  CONN.open CONNSTR
  If Err Then
			Err.Clear
			Response.Write "连接出错,请检查数据库连接字符串!"
			Response.End
  End If
End Function 
 
Sub HX_ClosDB()'取得关闭数据库对象
  if isobject(conn) then
    CONN.close:Set CONN = Nothing
  end if
End Sub
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?