The Essence | data | database | array | Batch input method using array to realize database record in original ASP (original)
Demo: http://www.zwtd.com/1/yanek/n/needdj2.asp
<%
REM article topic ASP using array to realize the batch input method of database record (original)
Author: Yanek
Contact Email:aspboy@263.net
%>
Includes two files
1. Allneeddj.asp: Implementing Form Generation
2. allneeddjresult.asp processing Form Batch Input
3.hbedu.mdb: Database files
Its database structure is as follows
Provinceid: Province number numeric type
Dytaocount: Proofing the number of arrays
Papertaocount: pattern Number of numbers
Cpcontent: The value of the content of the film
FileName: FileName text type
Beizhu: Memo Note type
In this example, 10 records, 6 fields per record are described.
1. Allneeddj.asp
<meta http-equiv= "Content-language" content= "ZH-CN" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "generator" content= "Microsoft FrontPage 4.0" >
<meta name= "ProgId" content= "FrontPage.Editor.Document" >
<title> Requirements Registration </title>
<body>
<%
Set Conn=server.createobject ("Adodb.connection")
Conn. Open driver={microsoft Access Driver (*.mdb)};d bq= "& _
Server.MapPath ("Hbedu.mdb")
%>
<form method= "POST" action= "allneeddjresult.asp" >
<div align= "center" >
<center>
<table border= "1" width= "M" bordercolorlight= "#FFFFFF" >
<tr>
<TD width= "660" colspan= "6" >
<p align= "center" > Requirement Registration </td>
</tr>
<tr>
<TD width= "si" align= "center" > Province </td>
<TD width= "align=" "Center" > Proofing Sheets </td>
<TD width= "align=" "Center" > Pattern Sheets </td>
<TD width= "align=" "Center" > Content </td>
<TD width= "align=" "Center" > FileName </td>
<TD width= "328" align= "Center" >
<p align= "center" > Notes </td>
</tr>
<%
REM generates different name form fields dynamically by looping
For I=1 to 10
%>
<%
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from Provinceinfo"
Rs.Open sql,conn,1,1
Set Rs1=server.createobject ("Adodb.recordset")
Sql1= "SELECT * from filename"
Rs1.open sql1,conn,1,1
%>
<tr>
<TD width= "si" ><select name= "<% Response.Write" data1 "&i%>"
Size= "1" >
<%
Do as not rs.eof
If Province=cstr (RS ("id")) Then
Sel= "Selected"
Else
Sel= ""
End If