📄 к+
字号:
<%
vServer="http://" & Request.ServerVariables("Server_name")
%>
<%
CategoryID=Request("CategoryID")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>学生基本档案资料录入</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body background="B01.jpg">
<h3>
<object id="RDS1" classid="ClsID:BD96C556-65A3-11D0-983A-00C04FC29E33" align="baseline"
border="0" width="7" height="14">
<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="14" height="14">
<param name="AllowAddnew" value="true">
<param name="AllowDelete" value="true">
<param name="AllowUpdate" value="true">
<param name="allowarrows" value="true">
</object>
档案基本资料录入</h3>
<div align="left">
<table border="1" cellspacing="1" width="725" height="308">
<tr>
<td width="488" valign="top" height="166">
<object id="grid1" classid="clsid:00028CD1-0000-0000-0000-000000000046"
codebase="http://xk_server/test/tdbg6.ocx" align="baseline" border="0" width="505"
height="153" datasrc="#rds1">
<param name="allowaddnew" value="0">
<param name="allowupdate" value="0">
</object>
</td>
<td width="185" valign="top" height="166"><img id="photoid" datasrc="#rds1"
Datafld="图片" width="166" height="166" alt="学生相片"> </td>
</tr>
<tr>
<td width="488" valign="top" height="163">
<object id="grid2" classid="clsid:00028CD1-0000-0000-0000-000000000046" caption="ttt"
codebase="http://xk_server/test/tdbg6.ocx" align="baseline" border="0" width="503"
height="153" datasrc="#rds2">
<param name="allowaddnew" value="0">
<param name="allowupdate" value="0">
</object>
</td>
<td width="185" rowspan="2" height="130" valign="middle"> <p>
<input type="button" value="新增数据" name="B1"
style="font-family: 宋体; font-size: 17" onclick="recordadd()"></p>
<p> <input type="button" value="保存数据"
name="B2" onclick="SubmitChanges()" style="font-family: 宋体; font-size: 17"></p>
<p> <input type="button" value="查询数据"
name="B3" onclick="recordfind()" style="font-family: 宋体; font-size: 17"></p>
<p> <input type="button" value="删除数据"
name="B4" onclick="recorddelete()" style="font-family: 宋体; font-size: 17"></td>
</tr>
<tr>
<td width="488" height="1"> 学号:<input type="text" name="code_id" size="10">
姓名:<input type="text" name="name_id" size="8"></td>
</tr>
<script language="vbscript">
rds1.server=vserver
rds1.connect="database=school;uid=sa;pwd=;dsn=school"
rds1.sql="select * from student"
rds1.executeoptions=1
rds1.refresh
rds2.server=vserver
rds2.connect="database=school;uid=sa;pwd=;dsn=school"
rds2.sql="select * from <%=CategoryID%> where ltrim(rtrim(学号))='"<rim(rtrim(grid1.columns.item(0)))&"'"
rds2.executeoptions=1
rds2.refresh
'msgbox code_id.value
sub recorddelete()
if grid2.row<0 then
msgbox "没有数据可删除"
else
l_ok = msgbox("你真的要删除此项目吗!",1,"提示")
if l_ok = 1 then
rds2.recordset.delete
grid2.rebind
end if
end if
end sub
Sub SubmitChanges()
moveflag = true
if grid2.row > 0 then
grid2.row = grid2.row -1
else
grid2.row =grid2.row +1
moveflag = false
end if
grid2.Editactive = False
On Error resume next
RDS2.SubmitChanges
If Err.Number <> 0 Then
'RDS1.CancelUpdate
MsgBox "无法更新数据!"
else
' l_tag="0"
End If
' if moveflag then
' grid2.row = grid2.row +1
' else
' grid2.row = grid2.row -1
' end if
end sub
sub recordadd()
grid2.editactive=true
rds2.recordset.addnew
rds2.recordset.movelast
grid2.columns.item(0).value=grid1.columns.item(0)
end sub
sub grid1_dblclick()
rds2.sql="select * from <%=CategoryID%> where ltrim(rtrim(学号))='"<rim(rtrim(grid1.columns.item(0)))&"'"
rds2.executeoptions=1
rds2.refresh
end sub
sub recordfind()
if len(trim(code_id.value))<>0 then
grid1.row=0
ef=false
' msgbox ef
while not ef
if ltrim(rtrim(grid1.columns.item(0)))=ltrim(rtrim(code_id.value)) then
rds2.sql="select * from <%=CategoryID%> where ltrim(rtrim(学号))='"<rim(rtrim(grid1.columns.item(0)))&"'"
rds2.executeoptions=1
rds2.refresh
ef=true
else
If Not RDS1.Recordset.EOF Then
RDS1.Recordset.MoveNext
End If
if rds1.recordset.eof=true then
msgbox "没有找到此学生!"
ef=flase
exit sub
end if
end if
wend
elseif len(trim(name_id.value))<>0 then
grid1.row=0
ef=false
while not ef
if ltrim(rtrim(grid1.columns.item(2)))=ltrim(rtrim(name_id.value)) then
rds2.sql="select * from <%=CategoryID%> where ltrim(rtrim(学号))='"<rim(rtrim(grid1.columns.item(0)))&"'"
rds2.executeoptions=1
rds2.refresh
ef=true
else
If Not RDS1.Recordset.EOF Then
RDS1.Recordset.MoveNext
End If
if rds1.recordset.eof=true then
msgbox "没有找到此学生!"
ef=flase
exit sub
end if
end if
wend
else
msgbox "请输入查寻条件学号或者姓名!"
end if
end sub
</script>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -