0

So I'm trying to read and display all entrys from the MDB file with the status as 2 and I keep getting this error:

An exception of type 'System.Data.OleDb.OleDbException' occurred in Microsoft.VisualBasic.dll but was not handled in user code

When I take out the Where status = 2 it works fine but I need the where in there.

<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>
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
the1osu
  • 23
  • 2

0 Answers0