<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OLEDB" %>
<html>
<head>
    <script language="C#" runat="server">
       void SubmitBtn_Click(Object sender, EventArgs e)
	Dataset DS;
	string x = Request.FilePath;//取得路径及文件名
	dim u as string=Left(Request.PhysicalPath,Len(Request.PhysicalPath)-Len("Search.ASPX")-1);'扣除文件名
	OLEDBConnection NowConn = New OLEDBConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & u & "\a21.MDB")
	OleDbDataAdapter NComm = New OleDbDataAdapter("select * from ac20 where content like '%" & Keyword.value & "%'", NowConn)        
	DS = new DataSet()
	NComm.Fill(ds, "ac20")
	datalist1.DataSource=ds.Tables("ac20").DefaultView
	datalist1.DataBind()
       End Sub
    </script>

</head>
<body background="../../../images/winback.gif">
<!--#INCLUDE FILE="../../../fun.inc"--> 
    <h3><font face="Verdana">Access 2000实战问答集第一章全文检索</font></h3>
    <form runat=server>
        请输入搜索的关键字: <input id="Keyword" type=text size=20 runat=server>
        <input type=submit value="确定" OnServerClick="SubmitBtn_Click" runat=server>
        <p>
       <span id="Span1" style="color:red" runat=server></span>
    </form>
        <asp:DataList id="dataList1" runat="server"
          RepeatColumns="1"
          Width="80%"
          BorderColor="black"
          BorderWidth="1"
          GridLines="Both"
          CellPadding="4"
          CellSpacing="0"
>
            <ItemTemplate>
                章名: <%# DataBinder.Eval(Container.DataItem, "chap") %>
		<p>
                节名: <%# DataBinder.Eval(Container.DataItem, "period") %>
		<p>
                内容: <%# DataBinder.Eval(Container.DataItem, "content") %>
		<p>
           </ItemTemplate>
</asp:Datalist>

</body>
</html>
