<% function PCase(strInput) 'Variable declaration. Dim strArr Dim tmpWord Dim tmpString Dim last 'Create an array To store Each word In the String separately. strArr = strInput strArr = LCase(strArr) tmpWord = Ucase(mid(strArr,1,1)) & mid(strArr,2,len(strArr)) strArr = tmpWord PCase = strArr End function %> Display

Display the members whose last name start with:
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, ALL
<% dim connstr dim db dim conn2008 dim rs2008 dim connstr2008 dim sql2008 dim changeid dim changeaction dim startstr startstr=request("startstr") db="/Conferences/Conf2008/form/IACMRDATA2008.mdb" Set conn2008 = Server.CreateObject("ADODB.Connection") connstr2008="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db) conn2008.Open connstr2008 if startstr="" then sql2008="select * from conference2008 where audit=1 order by lastname,receivedata" else sql2008="select * from conference2008 where audit=1 and ( lastname like '" & startstr & " %'or lastname like '" & lcase(startstr) & "%' )order by lastname,receivedata" end if %> <% if Request.QueryString("PageNumber").count > 0 then ' 指定页号的参数PageNumber.如果指定页号,则以指定页号为依据 PageNumber = Request.QueryString("PageNumber")(1) else PageNumber = 1 ' 如没指定页号,缺省为1 end if RecordNumberPerPage = 1000 ' 每页显示10条记录 'set ARecordSet = Server.CreateObject("ADODB.RecordSet") 'ARecordSet.open "select * from contact1",AConnection,1 set rs2008=server.createobject("adodb.recordset") rs2008.open sql2008,conn2008,3,2 if not rs2008.eof then ' 执行查询,注意Open语句中指定的第三个参数 rs2008.PageSize = RecordNumberPerPage ' 指定每页记录条数 rs2008.AbsolutePage = PageNumber ' 指定当前页号 Response.Write "
"&rs2008.PageSize&" pieces of records per page" Response.Write "
"&rs2008.PageCount&" pages in total" Response.Write "
This is page"&PageNumber&"" Response.Write "" ' 以表格形式显示查询结果 Response.Write "" For FieldNo = 2 to 5 if fieldno<> 4 then Response.Write "" else Response.Write "" end if Next Response.Write "" Response.Write "" Response.Write "" ' 显示字段名 RecordCounter = 0 Do while not rs2008.eof RecordCounter = RecordCounter + 1 ' 显示查询 if RecordCounter > RecordNumberPerPage then ' 如果要显示的记录数大于每页记录数目,则停止显示 Exit do end if Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" ' 显示一条记录 rs2008.MoveNext Loop ' 转向下一条记录 Response.Write "
"&rs2008( FieldNo ).Name&" Middle Name or Chinese Name Name Badge Spouse Name For Courtesy Badge
 "&ucase(rs2008( 2 ))&"  "&pcase(rs2008( 3 ))&"  "&rs2008( 4 )&"  "&rs2008( 5 )&"  "&rs2008( 16 )&"  "&rs2008( 17 )&"
" if PageNumber > 1 then ' 如果不是第一页,则提示上一页 Response.Write "

[previous]" end if if not rs2008.eof then ' 如果还有记录没有显示,则提示下一页 Response.Write "[next]" end if else Response.Write "No results!" end if rs2008.close %>