There are the following forms, you want to query a record, press the field output (field name fieldname1,fieldname2 ...). Please specify according to the field name in your table:
Input.htm
<form method= "Post" action= "test.asp" Name= "Form1" >
<input type= "text" name= "Bianhao" size= "ten" >
<input type= "checkbox" Name= "C1" value= "FieldName1" >
<input type= "checkbox" Name= "C1" value= "FieldName2" >
...
<input type= "Submit" value= "submitted" >
</form>
The corresponding ASP file as follows, this code is very versatile (database mymdb.mdb you specify, table name tablename you specify):
Test.asp
<%
Dim Fieldnames,fields
FieldNames = ""
' Traverse the form checkbox to save the selected field to a string variable filednames
For each fieldname in Request ("C1")
FieldNames = FieldNames & "," & FieldName
Next
' Determine if there are options
If FieldNames = "" Then
Response.Write "<center>Response.End
End If
' Connect the database, open the recordset RS
strSQL = "Select" & Mid (fieldnames,2) & "from TableName Where bianhao= '" & Request ("Bianhao") & ""
strconn = "Driver={microsoft Access DRIVER (*.mdb)};D bq=" & Server.MapPath ("Mymdb.mdb")
Set Rs = Server.CreateObject ("ADODB.") RecordSet ")
Rs.Open strsql,strconn,1,1
' Explode string variable filednames, output results by selected field
Fields = Split (FieldNames, ",")
For i = 1 to UBound (fields)
Response.Write Fields (i) & ":" & Rs (Fields (i)) & "<br>"
Next
Rs.close
%>