⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 const.asp

📁 投资管理系统, asp+ mssql server
💻 ASP
字号:
<%

Function GetUserID(strName)
	strName=trim(strName)
	if strName<>"" then
		Set oRsTmp = Server.Createobject("Adodb.recordset")
		strSql = "Select ID from tblUserLogin where Name='"& strName &"'"
		oRsTmp.open strSql,conn,1,1
		If not oRstmp.eof then
			GetUserID=trim(oRstmp("ID"))
		else
			GetUserID=0
		end if
		oRstmp.close
		set oRsTmp = Nothing
	else
		GetUserID=0
	end if
End Function

Function GetUserName(ID)
	if Isnumeric(ID) and ID<>"" and ID<>0 then
		Set RsTmp = Server.Createobject("Adodb.recordset")
		strSql = "Select Name from tblUserLogin where ID="& ID
		Rstmp.open strSql,conn,1,1
		If not Rstmp.eof then
			GetUserName=trim(Rstmp("Name"))
		else
			GetUserName=""
		end if
		Rstmp.close
		set RsTmp = Nothing
	else
		GetUserName=""
	end if
End Function

Function GetTableValue(TableName,Field,ID)
	if Isnumeric(ID) and ID<>"" and ID<>"0" then
		Set RsTmp = Server.Createobject("Adodb.recordset")
		strSql = "Select "& Field &" from "& TableName &" where ID="& ID
		Rstmp.open strSql,conn,1,1
		If not Rstmp.eof then
			GetTableValue=trim(Rstmp(Field))
		else
			GetTableValue=""
		end if
		Rstmp.close
		set RsTmp = Nothing
	else
		GetTableValue=""
	end if
End Function

Function GetTableValue_ID(TableName,Field,ID)
	if Isnumeric(ID) and ID<>"" and ID<>"0" then
		Set RsTmp = Server.Createobject("Adodb.recordset")
		strSql = "Select "& Field &" from "& TableName &" where ID="& ID
		Rstmp.open strSql,conn,1,1
		If not Rstmp.eof then
			GetTableValue_ID=trim(Rstmp(Field))
		else
			GetTableValue_ID=""
		end if
		Rstmp.close
		set RsTmp = Nothing
	else
		GetTableValue_ID=""
	end if
End Function

Function Get_text_field(p_tableName,p_ID)
	if Isnumeric(p_ID) and p_ID<>"" and p_ID<>"0" then
		response.redirect "http://192.168.8.87/itd/get_text/get_text_field.jsp?ID="&p_ID&"&tableName="&p_tableName
	else
		Get_text_field=""
	end if
End Function


Function FindIt(TableName, ID)
	If isnumeric(ID) then
		Set RsTmp = Server.Createobject("Adodb.recordset")
		strSql="select ID from "& TableName &" where ID="& ID
		RsTmp.open strSql,conn,1,1
		If not Rstmp.eof then
			FindIt=true
		else
			FindIt=false
		end if
	else
	FindIt=false
	end if
End Function

Function FindItem(TableName, FieldName, Value)
	Set RsTmp = Server.Createobject("Adodb.recordset")
	strSql="select ID from "& TableName &" where "& FieldName &"='"& Value &"'"
	RsTmp.open strSql,conn,1,1
	If not Rstmp.eof then
		FindItem=true
	else
		FindItem=false
	end if
End Function

sub DeleteOneFile (FilePathName)
	FilePathName=Server.Mappath(FilePathName)
	dim fs
	Set fs = server.CreateObject("Scripting.FileSystemObject")
	if trim(FilePathName)<>"" and fs.FileExists(FilePathName) then 
		fs.DeleteFile FilePathName
	end if
	set fs=nothing	
end sub

sub DeleteOneDir (PathName)
	PathName=Server.Mappath(PathName)
	dim fsfl
	Set fsfl = server.CreateObject("Scripting.FileSystemObject")
	if trim(PathName)<>"" and fsfl.FolderExists(PathName) then 
		fsfl.DeleteFolder PathName
	end if
	set fsfl=nothing	
end sub

Function RequestForm(InputName)
	InputName=trim(InputName)
	IF InputName="" then
	exit Function
	end if
	RequestForm=replace(trim(Request(InputName)),"'","''")
End Function
%>

⌨️ 快捷键说明

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