所以我正在尝试从状态为2的MDB文件中读取并显示所有来源,并且我一直收到此错误:
Microsoft.VisualBasic.dll中发生了'System.Data.OleDb.OleDbException'类型的异常,但未在用户代码中处理
当我拿出Where status = 2时它工作正常,但我需要那里的地方。
<script runat="server">
sub Page_Load
Dim dataconnector, strSQL, datacommand, dataread
dataconnector = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & Server.MapPath("cgiclass.mdb"))
strSQL = "SELECT * FROM suppliers WHERE status = 2"
dataconnector.Open()
datacommand = New OleDbCommand(strSQL, dataconnector)
dataread = datacommand.ExecuteReader()
suppliers.DataSource = dataread
suppliers.DataBind()
dataread.Close()
dataconnector.Close()
End Sub
</script>