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

📄 -+-

📁 我的图书管理系统
💻
字号:

<%
dim Pri
mkmc=request("mkmc")
Pri=CheckUrl(mkmc)
%>
<!--#include virtual="/school/public/CheckUrl.asp"-->
<%
vServer="http://" & Request.ServerVariables("Server_name")
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb_2312-80">
<meta name="tjh" content="Microsoft FrontPage Express 2.0">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>图书类别设置</title>
</head>

<body background="Bkg35.jpg">

<p><img src="../images/cat1.gif"><font size="6" color="#ff0000">图书类别设置
<object id="RDS1" classid="ClsID:BD96C556-65A3-11D0-983A-00C04FC29E33" align="baseline"
border="0" width="25" height="4">
  <param name="AllowAddnew" value="true">
  <param name="AllowDelete" value="true">
  <param name="AllowUpdate" value="true">
  <param name="allowarrows" value="true">
</object>
<object id="RDS2" classid="ClsID:BD96C556-65A3-11D0-983A-00C04FC29E33" align="baseline"
border="0" width="26" height="12">
  <param name="AllowAddnew" value="true">
  <param name="AllowDelete" value="true">
  <param name="AllowUpdate" value="true">
  <param name="allowarrows" value="true">
</object></font>
<hr color="#ff0000">
<script language="vbscript">
   public  text11
    RDS1.Server = "http://<%=request.servervariables("server_name")%>"

    RDS1.Connect = "database=school;uid=sa;pwd=;dsn=school"

    RDS1.SQL = "select * from ttslb"

	rds1.executeoptions=1

    RDS1.Refresh

    RDS2.Server = "http://<%=request.servervariables("server_name")%>"

    RDS2.Connect = "database=school;uid=sa;pwd=;dsn=school"

    
</script>

<div align="left">

<table border="1" width="100%" height="328">
  <tr>
    <td valign="top" width="78%" height="322">
    <object id="grid1" name="grid1" classid="clsid:00028CD1-0000-0000-0000-000000000046"
     CODEBASE="http://<%=Request.ServerVariables("SERVER_NAME")%>/school/public/tdbg6.ocx"
    align="baseline" border="0" width="100%" height="100%" datasrc="#rds1">
      <param name="allowaddnew" value="0">
      <param name="allowupdate" value="0">
    </object>
    </td>
    <td height="322"><p align="center"><input type="button" value="添加数据"
    name="insert" onclick="addrecord()" style="font-family: 宋体; font-size: 15"></p>
    <p align="center"><input type="button" value="删除数据" name="delete"
    onclick="delrecord()" style="font-family: 宋体; font-size: 15"></p>
    <p align="center"><input type="button" value="保存数据" name="save"
    onclick="SubmitChanges()" style="font-family: 宋体; font-size: 15"></p>
    <p align="center"><input type="button" value="取消修改" name="cancle"
    onclick="cancelupdate()" style="font-family: 宋体; font-size: 15">
    <p align="center"><input type="button" value="退出返回" name="return"
    onclick="returning()" style="font-family: 宋体; font-size: 15"></td>
  </tr>
</table>
</div>

<script language="vbscript">

Sub SubmitChanges()
	moveflag = true
	if grid1.row > 0 then
   	    grid1.row = grid1.row - 1
	else
		grid1.row =grid1.row +1
		moveflag = false
	end if

	grid1.Editactive = False
   On Error resume next
   RDS1.SubmitChanges
   If Err.Number <> 0 Then
      'RDS1.CancelUpdate
      MsgBox "无法更新数据!"
   End If
	if  moveflag then
      grid1.row = grid1.row +1
	else
		grid1.row = grid1.row -1
	end if

End Sub

Sub CancelUpdate()
   On Error Resume Next
   RDS1.CancelUpdate
   If Err.Number <> 0 Then
      'RDS1.CancelUpdate
      MsgBox "无法恢复原来数据!"
   End If
   Grid1.Rebind
End Sub

sub addrecord()
  'grid1.setfocus	
  grid1.EditActive = true
  rds1.recordset.addnew
  grid1.col = 0	
  
End sub

sub delrecord()
	IF NOT rds1.recordset.EOF  and NOT rds1.recordset.BOF then
		l_ok= msgbox ("是否删除该数据",1,"提示窗口")
	  if l_ok=1 then	
		rds1.recordset.delete
		grid1.Rebind
	  else
	    exit sub
	  end if   	
	else
		msgbox "已经到数据库的末尾或开始!不能删除!"
   end if 
end sub



sub grid1_BeforeColUpdate(colindex,oldvalue,cancle)
	new_value = grid1.columns.item(colindex)
	select case colindex
	case 0
		
		rds2.sql = "select *  from ttslb where rtrim(ltrim(类别编号))='"&rtrim(ltrim(new_value))&"'"
		rds2.ExecuteOptions = 1	
		rds2.refresh
		if rds2.recordset.recordCount>0 then
		    msgbox "类别编号重复!请重新输入"
		    cancle = true
		end if
	case 1
		
		rds2.sql = "select *  from ttslb where rtrim(ltrim(类别名称))='"&rtrim(ltrim(new_value))&"'"
	
		rds2.ExecuteOptions = 1	
		rds2.refresh
		if rds2.recordset.recordCount>0 then
		    msgbox "类别名称重复! 请重新输入"
		    cancle = true
		end if
	

			
	end select
end sub

sub field_Gotfocus()
	if len(trim(condition_id.value)) = 0 then
		field_select = false
		compare_select = false
		express_select = false
		logic_select = false
	end if

	if colcount > 0 then
		exit sub
	end if 
	colcount = grid1.columns.count
	fieldname(0)="学号"
	for i=1 to colcount-1 
		  colcaption = grid1.columns.item(i).caption
		  fieldname(i) = colcaption
		  set oOption = document.createElement("OPTION")
		  oOption.text  = colcaption
	      oOption.value = cstr(i+1)
	      document.all.field_id.add(oOption)		
	next

end sub 

sub field_getSelect()

	if field_select then
		exit sub
	end if
	condvalue = condition_id.value
	condition_id.value = condvalue + fieldname(field_id.selectedindex)	
	field_select = true
	compare_select = false
	express_select = false
	logic_select = false
end sub

sub compare_getSelect()
	if compare_select then
		msgbox "已经输入比较操作符!"
		exit sub 
	end if 

	condvalue = condition_id.value
	if len(trim(condvalue)) = 0 then
		condvalue = "学号"
	end if
	select case compare_id.selectedindex
		case 0
			condvalue = condvalue + "="
		case 1
			condvalue = condvalue + ">"
		case 2
			condvalue = condvalue + "<"

		case 3
			condvalue = condvalue + "<="
		case 4
			condvalue = condvalue + ">="
		case 5
			condvalue = condvalue + "<>"
		case 6
			condvalue = condvalue + " like "
	end select 
	condition_id.value = condvalue
	compare_select = true
end sub

sub logic_getfocus()
    if len(trim(express_id.value))=0 then		
		msgbox "条件不能为空,请先输入条件表达式!"

	end if
end sub 

sub logic_getSelect()
	if logic_select then
		exit sub
	end if 
	condvalue = condition_id.value
	select case logic_id.selectedIndex
		case 0
			condvalue = condvalue + " and "
		case 1
			condvalue = condvalue + " or "
	end select
	condition_id.value=condvalue
	logic_select = true
	field_select = false
end sub

sub express_input()
	condvalue = condition_id.value
	if not compare_select then
		msgbox "请先输入比较操作符!"
		exit sub
	end if
	if len(trim(condvalue))=0 then
		condvalue = "学号="
	end if
	if len(trim(express_id.value))>0 and compare_id.selectedindex <> 6 then
		condvalue = condvalue + "'" + express_id.value + "'"
		condition_id.value = condvalue
    elseif len(trim(express_id.value))>0 and compare_id.selectedindex = 6 then
		condvalue = condvalue + "'%" + express_id.value + "%'"
		condition_id.value = condvalue
	else
		msgbox "条件不能为空,请重新输入条件表达式!"
	end if
end sub

sub freeOrder()

end sub


sub freeSearch()
	if len(trim(condition_id.value))=0 then
		msgbox "请先输入查询条件!"
		exit sub
	end if
	rds1.sql =savesql + " where " + condition_id.value
	'msgbox rds1.sql
	on error resume next
	rds1.ExecuteOptions = 1	
	rds1.refresh

	if rds1.recordset.recordcount = 0 then
		msgbox "对不起!没有找到符合条件的记录!"
		rds1.sql = saveSQL
		rds1.refresh
	else
		msgbox "总共找到 " + cstr(rds1.recordset.recordcount) +" 条符合条件的记录!"
		search_flag = true
	end if
end sub


sub backing()

	if search_flag then
		rds1.sql = saveSQL
		rds1.refresh
	end if
	
end sub


sub grid1_BeforeColEdit(colindex,keyascii,cancel)
	set colsel = grid1.columns.item(colindex)
	select case colsel.caption
	
	case "图片" 
		photodlg.showopen

		if len(trim(photodlg.filename))>0 then

			'msgbox photodlg.filename

			grid1.columns.item(colindex).value = photodlg.filename

		end if		
				
		cancel = true	

	end select

end sub
sub returning()
  history.go(-1)
end sub  

</script> </p>
</body>
</html>

⌨️ 快捷键说明

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