推奨:ASP Recordsetページングで負の数字を解きますレコードセットのページング中のマイナス数の現象については、多くの人がこの問題に遭遇したと思います。 負の数は主にカーソルタイプに関連しているように見えます。 (例の便利さのために、データベースをリンクして含めたconn.aspファイルがすでにあるとします)
SDCMSオンライン提出プログラム
コードは次のとおりです
<! - #file = inc/conn.aspを含める - >
<link href = style.css rel = styleSheet type = text/css>
<style type = text/css>
<! -
.style1 {color:#ff0000}
ボディ、td、th {
フォントサイズ:12px;
}
- >
</style>
<スクリプト言語= javascript>
function isfull()
{
var title = document.myform.title.value;
var content = document.myform.content.value;
var classid = document.myform.classid.value;
var著者= document.myform.author.value;
var code = document.myform.code.value;
if(title ==)
{
アラート(タイトルはどうですか?);
document.myform.title.focus();
falseを返します。
}
if(content ==)
{
アラート(コンテンツを書く);
document.myform.content.focus();
falseを返します。
}
if(classid ==)
{
アラート(分類を選択...);
document.myform.classid.focus();
falseを返します。
}
if(著者==)
{
アラート(名前を残す);
document.myform.author.focus();
falseを返します。
}
if(code ==)
{
アラート(残念ながら、検証マレーをもたらすことを忘れないでください);
document.myform.code.focus();
falseを返します。
}
if(classid ==)
{
アラート(分類を選択...);
document.myform.classid.focus();
}
trueを返します。
}
</script>
<Title> Jokes Onlineを提出</title>
</head>
<テーブル幅= 777境界= 0 align = center cellpading = 0 cellpacing = 0 bgcolor =#ffffff>
<tr>
<td width = 567 valign = top>
<テーブル幅= 100%境界= 0セルペーシング= 0>
<tr>
<td> <a href = http://joke.inyzi001.cn>ホームページに戻る</a>
<テーブル幅= 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>
<%request(action)= then%>
<テーブル幅= 100%Border = 0 CellPadding = 5 CellPacing = 0>
<tr>
<td width = 20%align = right> title </td>
<td width = 80%>
<入力名= title type = text id = wp size = 35>
* 30語が適切です^ - ^</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>
<入力名= classIDタイプ=テキストid = classIDサイズ= 3 readonly = readonly>
<%
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)> <オプション選択>カテゴリを選択してください
<%
rs_s.eofではありませんが
%>
<オプション値= <%= rs_s(id)%>> <%= rs_s(title)%> </option>
<%
rs_s.movenext
ウェンド
rs_s.close
rs_s =何も設定しません
%>
</select>
*分類は、シリアル番号</td>に自動的に対応します
</tr>
</table>
<テーブル幅= 100%Border = 0 CellPadding = 5 CellPacing = 1>
<tr>
<td width = 20%align = right bgcolor =#ffffff>著者</td>
<td width = 80%bgcolor =#ffffff> <入力タイプ=著者名=著者/>
- 仮名またはウェブサイトのアドレスは</td>になります
</tr>
<tr>
<td width = 20%align = right bgcolor =#ffffff>検証コード</td>
<td> <入力名= 'code' type = 'text' size = '6' maxlength = 4>
<img src = getcode.asp =はっきりと表示されます
</tr>
<tr>
<td width = 20%bgcolor =#ffffff>&nbsp; </td>
<td width = 80%bgcolor =#ffffff> <入力タイプ= submit name = submit2 value = my joke/> </td>を送信します
</tr>
</table>
<%end if>
</td>
</tr>
</form>
</table>
</td>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>
<%
リクエスト(アクション)=その後追加
isempty(session(getcode))またはsession(getCode)<> ucase(request.form(code))thenの場合
respons.write <script> window.alert( '検証馬はどこですか?私は草を食べに行きましたか?
Response.write <script> location.href = 'add.asp' </script>
Response.End
それ以外
薄暗いタイトル、コンテンツ、著者、ClassID
title = trim(request.form(title))
content = trim(request.form(content))
著者= trim(request.form(著者))
classID = trim(request.form(classID))
rs = server.createObject(adodb.Recordset)を設定します
sql = select * from sd_info
rs.open sql、conn、1,3
rs.addnew
savedata_dlinfo()に電話してください
rs.update
rs.close
rs = Nothingを設定します
closeconn()に電話してください
Response.Write <Script> Alert( 'OK!あなたの注意をありがとう!レビュー後に表示されます!')</script>
Response.redirect add.asp
ifを終了します
sub savedata_dlinfo
rs(title)= title
rs(content)= content
rs(著者)=著者
rs(classID)= classID
rs(adddate)= now
End Sub
ifを終了します
%>
共有:ASPインスタンスチュートリアル:FilesystemObjectオブジェクトファイルSystemObjectオブジェクトによって指定されたファイルは存在しますか? この例は、最初にFilesystemObjectオブジェクトを作成し、FeeExistsメソッドを使用してファイルが存在するかどうかを検出する方法を示しています。 この例のコードは次のとおりです。以下は参照されるコンテンツです:HTMLボディ%set fs = server.createobject(scripting.filesystemobject)if(fs.f