Recommended: Solve negative numbers in ASP Recordset paging Regarding the phenomenon of negative numbers during Recordset paging, I believe many people have encountered this problem. Sometimes Baidu and GOOGLE are not solved. Let me summarize it now. Negative numbers appear mainly related to the cursor type. (For the convenience of example, suppose there is already a conn.asp file that links the database and has included) Now give an example, the code is like
sdcms online submission program
The code is as follows
<!--#include file=inc/conn.asp -->
<link href=style.css rel=stylesheet type=text/css>
<style type=text/css>
<!--
.STYLE1 {color: #FF0000}
body,td,th {
font-size: 12px;
}
-->
</style>
<script language=javascript>
function isfull()
{
var title = document.myform.title.value;
var content = document.myform.content.value;
var classid = document.myform.classid.value;
var author = document.myform.author.value;
var code = document.myform.code.value;
if(title == )
{
alert(What about the title?);
document.myform.title.focus();
return false;
}
if(content == )
{
alert (write some content);
document.myform.content.focus();
return false;
}
if(classid == )
{
alert(select classification...);
document.myform.classid.focus();
return false;
}
if(author == )
{
alert (Leave your name);
document.myform.author.focus();
return false;
}
if(code == )
{
alert (alas, don't forget to bring verification Malay);
document.myform.code.focus();
return false;
}
if(classid == )
{
alert(select classification...);
document.myform.classid.focus();
}
return true;
}
</script>
<title>Submit jokes online</title>
</head>
<table width=777 border=0 align=center cellpading=0 cellpacing=0 bgcolor=#FFFFFF>
<tr>
<td width=567 valign=top>
<table width=100% border=0 cellpacing=0>
<tr>
<td><a href=http://joke.yingzi001.cn>Return to homepage</a>
<table width=100% border=0 cellpacing=0 cellpadding=0>
<form action=add.asp?action=add method=post name=myform id=myform onSubmit=return isfull();>
<tr>
<td align=center>
<%if request(action)=then%>
<table width=100% border=0 cellpadding=5 cellpacing=0>
<tr>
<td width=20% align=right>Title</td>
<td width=80%>
<input name=title type=text id=wp size=35>
* 30 words are appropriate^-^</td>
</tr>
<tr>
<td width=20% align=right>Content</td>
<td>
<textarea name=content cols=60 rows=10 id=content></textarea></td>
</tr>
<tr>
<td width=20% align=right>Category</td>
<td>
<input name=classid type=text id=classid size=3 readonly=readonly>
<%
set rs_s=server.createobject(adodb.recordset)
rs_s.open select * from sd_class order by id ,conn,1,1
%>
<select name=select2 onChange=(document.myform.classid.value=this.options[this.selectedIndex].value)><option selected> Please select the category
<%
while not rs_s.eof
%>
<option value=<%=rs_s(id)%>><%=rs_s(title)%></option>
<%
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
</select>
* Classification automatically corresponds to serial numbers</td>
</tr>
</table>
<table width=100% border=0 cellpadding=5 cellpacing=1>
<tr>
<td width=20% align=right bgcolor=#FFFFFF>Author</td>
<td width=80% bgcolor=#FFFFFF><input type=author name=author/>
- Your pseudonym or website address can be</td>
</tr>
<tr>
<td width=20% align=right bgcolor=#FFFFFF>Verification code</td>
<td><input name='code' type='text' size='6' maxlength=4>
<img src=getcode.asp alt= Can't see clearly? Click to change the style=cursor:pointer;height:20px; onclick=this.src='getcode.asp'></td>
</tr>
<tr>
<td width=20% bgcolor=#FFFFFF> </td>
<td width=80% bgcolor=#FFFFFF><input type=submit name=Submit2 value=Submit my joke/></td>
</tr>
</table>
<%end if%>
</td>
</tr>
</form>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
if request(action)=add then
If IsEmpty(Session(GetCode)) Or Session(GetCode) <> UCase(Request.Form(code)) Then
response.write <script>window.alert('Where is the verification horse? Going to eat grass? This site stipulates that you cannot submit without a horse...');</script>
response.write <script>location.href='add.asp'</script>
Response.End
Else
dim title,content,author,classid
title=Trim(request.Form(title))
content=Trim(request.Form(content))
author=Trim(request.Form(author))
classid=Trim(request.Form(classid))
set rs=server.createobject(adodb.recordset)
sql=select * from sd_info
rs.open sql,conn,1,3
rs.addnew
call SaveData_dlinfo()
rs.update
rs.close
set rs=nothing
call CloseConn()
response.write<script>alert('OK! Thank you for your attention! It will be displayed after review!')</script>
response.Redirect add.asp
end if
sub savedata_dlinfo
rs(title)=title
rs(content)=content
rs(author)=author
rs(classid)=classid
rs(adddate)=now
end sub
end if
%>
Share: ASP instance tutorial: FileSystemObject Object Does the file specified by the FileSystemObject object exist? This example demonstrates how to first create a FileSystemObject object, and then use the FileExists method to detect whether a file exists. The code of this example is as follows: The following is the referenced content: html body %Set fs=Server.CreateObject(Scripting.FileSystemObject) If (fs.F