正在学习asp.net,用的是vb.net。一个留言板的程序,不过没有通过,郁闷,求助各位大侠,不胜感激!错误提示:
Server Error in '/' Application.
--------------------------------------------------------------------------------Could not find installable ISAM.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Could not find installable ISAM.Source Error:
Line 89: Cmd = New OleDbDataAdapter("Select * from"& Table &" Order By post_time DESC",ConnStr)
Line 90: Dim ds As DataSet = New DataSet()
Line 91: Cmd.Fill(ds,Table)
Line 92: CreateDataView = New DataView(ds.Tables(Table))
Line 93: End Function
Source File: E:\Inetpub\class\11\guestbook.aspx Line: 91 Stack Trace:
[OleDbException (0x80004005): Could not find installable ISAM.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
ASP.guestbook_aspx.CreateDataView(String Db, String Table) in E:\Inetpub\class\11\guestbook.aspx:91
ASP.guestbook_aspx.Page_Load(Object sender, EventArgs e) in E:\Inetpub\class\11\guestbook.aspx:80
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
程序源文件:
<%@ Page Language="vb" Debug="true" %>
<%@ Import NameSpace="System.Data.OleDb" %>
<%@ Import NameSpace="System.Data" %>
<HTML>
<HEAD>
<title>Guestbook</title>
</HEAD>
<body BgColor="#ffffcc">
<h3>留言本<HR></h3>
<div id="Message" runat="server"></div>
<form runat="server">
<table cellpadding="0" cellspacing="0" width="700" border="0">
<tr bgcolor="#9999ff">
<td width="98%" align="middle">
<font face="宋体" color="#ffffcc"><b>留言本</b></font>
</td>
</tr>
</table>
<asp:DataList id="DataList1" Runat="server" Border="1" BorderColor="#000000" CellPadding="2" CellSpacing="0" HeaderStyle-BackColor="#eeeeee" SelectedItemStyle-BackColor="#ffffff" headerTemplate-Colspan="3" OnItemCommand="DataList_ItemCommand" Width="700">
<HeaderTemplate>
<asp:LinkButton ID="Tosay" Runat="server"
Text="我要发言" ForeColor="#FF3333" />
<a href="guestbook.aspx"><font color="#FF3333">刷新界面</font></a>
</HeaderTemplate>
<ItemTemplate>
<%# Container.DataItem("book_id") %>
<%# Container.DataItem("content") %>
<asp:LinkButton ID="Detail" Runat="server"
Text="查看详细内容" ForeColor="#333333" />
</ItemTemplate>
<SelectedItemTemplate>
编号:<%# Container.DataItem("book_id") %><br>
发言人:<%# Container.DataItem("username") %><br>
时间:<%# Container.DataItem("post_time") %><br>
内容:<%# Container.DataItem("content") %><br>
<div align="right">
<asp:LinkButton ID="Title" Runat="server"
Text="关闭" ForeColor="#333333" />
</div>
</SelectedItemTemplate>
</asp:DataList>
<table id="foot" cellspacing="0" cellpadding="0" width="700" border="0"
runat="server" visible="false">
<tr>
<td bgcolor="#ffffff">
<table cellspacing="1" cellpadding="3" width="700" border="0">
<tr bgcolor="#ffffff">
<td>
<P>姓名:<input type="text" id="Username" size="20" runat="server" NAME="Username">
<br>
留言:
<br>
<textarea id="Content" cols="50" runat="server"
rows="5" NAME="Content"></textarea>
</P>
<P>
<asp:LinkButton ID="save" Runat="server" Text="保存"
OnClick="LInkButton1_Click" AutoPostBack />
<FONT face="宋体">
</FONT>
<asp:LinkButton ID="close" Runat="server"
Text="关闭" OnClick="LinkButton2_Click" /></P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" width="700" border="0">
<tr bgcolor="#9999ff">
<td width="98%" align="middle"><font face="宋体" color="#ffffcc">
<b>留言本</b></font></td>
</tr>
</table>
</form>
<hr>
<asp:Label ID="Label1" Runat="server" />
<script language="vb" runat="server">
Sub Page_Load(sender As Object,e As EventArgs)
DataList1.DataSource = CreateDataView("sample.mdb","guestbook")
DataList1.DataBind()
End Sub
Function CreateDataView(Db As String,Table As String) As DataView
Dim Provider,ConnStr,SQL As String
Provider = "Microsoft.Jet.OLEDB.4.0;"
ConnStr = "Provider=" & Provider & "DataSource=" & Server.MapPath(Db)
Dim Conn As OleDbConnection = New OleDbConnection(ConnStr)
Dim Cmd As OleDbDataAdapter
Cmd = New OleDbDataAdapter("Select * from"& Table &" Order By post_time DESC",ConnStr)
Dim ds As DataSet = New DataSet()
Cmd.Fill(ds,Table)
CreateDataView = New DataView(ds.Tables(Table))
End Function
Sub DataList_ItemCommand(sender As Object,e As DataListCommandEventArgs)
select case e.CommandSource.Text
case "我要发言"
foot.Visible = True
case "查看详细内容"
DataList1.SelectedIndex = e.Item.ItemIndex
case "关闭"
DataList1.SelectedIndex = -1
End Select
DataList1.DataSource = CreateDataView("sample.mdb","guestbook")
DataList1.DataBind()
End Sub
Sub LinkButton2_Click(sender As Object,e As Eventargs)
foot.Visible = false
End Sub
Sub LinkButton1_Click(sender As Object,e As Eventargs)
Dim ConnStr,SQL As String
SQL = "Insert Into guestbook(userName,post_time,content) Values('"& Username.Value &"','"& DateTime.Now &"','"& Content.Value &"')"
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" & "DataSource=" & Server.MapPath("sample.mdb")
Dim Conn As OleDbConnection = New OleDbConnection(Connstr)
Conn.Open()
Dim Cmd As OleDbCommand = New OleDbCommand(SQL,Conn)
Cmd.ExecuteNonQuery()
Message.InnerHtml = "<B>留言成功!</B>"
foot.Visible = false
End Sub
</script>
</body>
</HTML>
Server Error in '/' Application.
--------------------------------------------------------------------------------Could not find installable ISAM.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Could not find installable ISAM.Source Error:
Line 89: Cmd = New OleDbDataAdapter("Select * from"& Table &" Order By post_time DESC",ConnStr)
Line 90: Dim ds As DataSet = New DataSet()
Line 91: Cmd.Fill(ds,Table)
Line 92: CreateDataView = New DataView(ds.Tables(Table))
Line 93: End Function
Source File: E:\Inetpub\class\11\guestbook.aspx Line: 91 Stack Trace:
[OleDbException (0x80004005): Could not find installable ISAM.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
ASP.guestbook_aspx.CreateDataView(String Db, String Table) in E:\Inetpub\class\11\guestbook.aspx:91
ASP.guestbook_aspx.Page_Load(Object sender, EventArgs e) in E:\Inetpub\class\11\guestbook.aspx:80
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
程序源文件:
<%@ Page Language="vb" Debug="true" %>
<%@ Import NameSpace="System.Data.OleDb" %>
<%@ Import NameSpace="System.Data" %>
<HTML>
<HEAD>
<title>Guestbook</title>
</HEAD>
<body BgColor="#ffffcc">
<h3>留言本<HR></h3>
<div id="Message" runat="server"></div>
<form runat="server">
<table cellpadding="0" cellspacing="0" width="700" border="0">
<tr bgcolor="#9999ff">
<td width="98%" align="middle">
<font face="宋体" color="#ffffcc"><b>留言本</b></font>
</td>
</tr>
</table>
<asp:DataList id="DataList1" Runat="server" Border="1" BorderColor="#000000" CellPadding="2" CellSpacing="0" HeaderStyle-BackColor="#eeeeee" SelectedItemStyle-BackColor="#ffffff" headerTemplate-Colspan="3" OnItemCommand="DataList_ItemCommand" Width="700">
<HeaderTemplate>
<asp:LinkButton ID="Tosay" Runat="server"
Text="我要发言" ForeColor="#FF3333" />
<a href="guestbook.aspx"><font color="#FF3333">刷新界面</font></a>
</HeaderTemplate>
<ItemTemplate>
<%# Container.DataItem("book_id") %>
<%# Container.DataItem("content") %>
<asp:LinkButton ID="Detail" Runat="server"
Text="查看详细内容" ForeColor="#333333" />
</ItemTemplate>
<SelectedItemTemplate>
编号:<%# Container.DataItem("book_id") %><br>
发言人:<%# Container.DataItem("username") %><br>
时间:<%# Container.DataItem("post_time") %><br>
内容:<%# Container.DataItem("content") %><br>
<div align="right">
<asp:LinkButton ID="Title" Runat="server"
Text="关闭" ForeColor="#333333" />
</div>
</SelectedItemTemplate>
</asp:DataList>
<table id="foot" cellspacing="0" cellpadding="0" width="700" border="0"
runat="server" visible="false">
<tr>
<td bgcolor="#ffffff">
<table cellspacing="1" cellpadding="3" width="700" border="0">
<tr bgcolor="#ffffff">
<td>
<P>姓名:<input type="text" id="Username" size="20" runat="server" NAME="Username">
<br>
留言:
<br>
<textarea id="Content" cols="50" runat="server"
rows="5" NAME="Content"></textarea>
</P>
<P>
<asp:LinkButton ID="save" Runat="server" Text="保存"
OnClick="LInkButton1_Click" AutoPostBack />
<FONT face="宋体">
</FONT>
<asp:LinkButton ID="close" Runat="server"
Text="关闭" OnClick="LinkButton2_Click" /></P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" width="700" border="0">
<tr bgcolor="#9999ff">
<td width="98%" align="middle"><font face="宋体" color="#ffffcc">
<b>留言本</b></font></td>
</tr>
</table>
</form>
<hr>
<asp:Label ID="Label1" Runat="server" />
<script language="vb" runat="server">
Sub Page_Load(sender As Object,e As EventArgs)
DataList1.DataSource = CreateDataView("sample.mdb","guestbook")
DataList1.DataBind()
End Sub
Function CreateDataView(Db As String,Table As String) As DataView
Dim Provider,ConnStr,SQL As String
Provider = "Microsoft.Jet.OLEDB.4.0;"
ConnStr = "Provider=" & Provider & "DataSource=" & Server.MapPath(Db)
Dim Conn As OleDbConnection = New OleDbConnection(ConnStr)
Dim Cmd As OleDbDataAdapter
Cmd = New OleDbDataAdapter("Select * from"& Table &" Order By post_time DESC",ConnStr)
Dim ds As DataSet = New DataSet()
Cmd.Fill(ds,Table)
CreateDataView = New DataView(ds.Tables(Table))
End Function
Sub DataList_ItemCommand(sender As Object,e As DataListCommandEventArgs)
select case e.CommandSource.Text
case "我要发言"
foot.Visible = True
case "查看详细内容"
DataList1.SelectedIndex = e.Item.ItemIndex
case "关闭"
DataList1.SelectedIndex = -1
End Select
DataList1.DataSource = CreateDataView("sample.mdb","guestbook")
DataList1.DataBind()
End Sub
Sub LinkButton2_Click(sender As Object,e As Eventargs)
foot.Visible = false
End Sub
Sub LinkButton1_Click(sender As Object,e As Eventargs)
Dim ConnStr,SQL As String
SQL = "Insert Into guestbook(userName,post_time,content) Values('"& Username.Value &"','"& DateTime.Now &"','"& Content.Value &"')"
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" & "DataSource=" & Server.MapPath("sample.mdb")
Dim Conn As OleDbConnection = New OleDbConnection(Connstr)
Conn.Open()
Dim Cmd As OleDbCommand = New OleDbCommand(SQL,Conn)
Cmd.ExecuteNonQuery()
Message.InnerHtml = "<B>留言成功!</B>"
foot.Visible = false
End Sub
</script>
</body>
</HTML>
Msexcl40.dll Microsoft Excel HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel
Msexch40.dll Microsoft Exchange HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Exchange
Msrd2x40.dll Microsoft Jet 2.x HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 2.x
Msrd3x40.dll Microsoft Jet 3.x HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 3.x
Msltus40.dll Lotus 1-2-3 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Lotus
Mspbde40.dll Imprise Paradox HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Paradox
Mstext40.dll Text HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Text
Msxbde40.dll dBase HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Xbase
2. 使用 Microsoft Windows 资源管理器搜索文件。
3. 如果找到此文件,请记下此文件的路径名称。如果找不到此文件,请转至步骤 13。
4. 打开 Windows 注册表编辑器。
5. 找到此表中描述的注册表子项,然后按照实际的路径名称检查此路径名称。如果此注册表项不存在,请转至步骤 8。
6. 如果路径错误,更正此路径。如果路径正确,继续执行这些步骤。
7. 关闭注册表编辑器。如果更改了此路径,请重复产生最初错误的过程。
8. 如果错误仍然存在,请使用 Regsvr32.exe 实用工具手动注册此文件。Regsvr32.exe 实用工具是用于在 Windows 注册表中注册 DLL 和 ActiveX 控件的应用程序。您可以使用此文件解决错误匹配的 .dll 文件的问题。要使用 Regsvr32.exe 实用工具重新注册 .dll 文件,请转至下一步。
9. 验证 Regsvr32.exe 文件是否位于装有 Windows 的系统文件夹中。例如,Regsvr32.exe 文件通常位于 C:\Windows\System 或 C:\Winnt\System32 中。
10. 单击“开始”,然后单击“运行”。
11. 在“运行”对话框中,在“打开”框中键入以下命令。注意:Regsvr32.exe 的路径和 DLL 的名称和路径在计算机中可能有些不同。以下命令可注册 Excel ISAM:Regsvr32 c:\winnt\system32\msexcl40.dll注意:注册 DLL 的另一种方法是使用 Windows 资源管理器找到 DLL。双击此 DLL。在“打开方式”对话框中,单击“Regsvr32.exe”,然后单击“确定”。这会创建所有 DLL 与 Regsvr32.exe 的永久关联。您可以双击其他未注册的 DLL,来注册这些 DLL。有关如何获得此文件的其他信息,请单击下面的文章编号,以查看 Microsoft 知识库中相应的文章:
267279 (http://support.microsoft.com/kb/267279/) Regsvr32.exe 可从下载中心下载
12. 如果错误仍然存在,或者已经在步骤 5 中更正了路径名称,请重命名此文件。
13. 启动“添加/删除程序”工具,启动 Office 2000 安装程序,然后单击“修复 Office”。
路径没错,难道是Provider的问题?VS2005的提示是:A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
很小,12k,包括源文件、数据库和Visual Studio 2005的项目文件。我怕万一是我本机系统的问题,所以哪位朋友方便请帮忙试试能不能过,非常感谢!
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|sample.mdb"