|
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/exercises.asp" -->
<%
//First, execute the server-side commands
var MathRs = Server.CreateObject("ADODB.Recordset");
MathRs.ActiveConnection = MM_mathconn_STRING;
MathRs.Source = "SELECT English, Chinese FROM exercises ORDER BY English ASC";
MathRs.CursorType = 0;
//MathRs.CursorLocation = 2; //forward only, does not support RecordCount
MathRs.CursorLocation = 3; //adUseClient, support RecordCount
MathRs.LockType = 1;
MathRs.Open();
Response.write("count="+MathRs.RecordCount); //supported by AdUseClient and adApproxPosition
var MathRs_numRows = 0;
//MathRs.MoveFirst();
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form name="form1" method="post" action="">
<%
MathRs.MoveNext(); //go to the next record
Response.write(MathRs.Fields.Item(0).Value); //write the first field, i.e. English to the web page. We call this dynamically generate web pages
%>
<!-- execute server-side commands-->
<p>中文:
<input name="ctext1" type="text" id="text" value="<%=(MathRs.Fields.Item("Chinese").Value)%>">
English:
<input name="etext1" type="text" id="etext1">
<input name="Button1" type="button" id="Button1" value="check">
<input name="key1" type="hidden" id="key1" value="<%=(MathRs.Fields.Item("English").Value)%>">
</p>
<p>中文:
<input name="ctext2" type="text" id="ctext2" value="<%=(MathRs.Fields.Item("Chinese").Value)%>">
English:
<input name="etext2" type="text" id="etext2">
<input name="Button2" type="button" id="Button2" value="Check">
<input name="key2" type="hidden" id="Key2" value="<%=(MathRs.Fields.Item("English").Value)%>">
</p>
</form>
</body>
</html>
<%
MathRs.Close(); //close the record set
%>
请问这段代码中应该如何写才能在ctext2和key2那里取到数据表中的chinese 和english字段下的第二个值? |
|