locked
Could not find installable ISAM RRS feed

  • Question

  • User-546863279 posted

     Hi guys...

    I'm trying to get my website to search through an access database and return relevent entries... I found a sample bit of code for a SQL database and I'm trying to adapt it to my needs...

    myConnectionString As String
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="testSiteONE._Default" %>
    <%@ Import Namespace="System.Data.OleDb" %>
    <%@ Import Namespace="System.Data" %>

    <script language="VB" runat="server">
        Sub btnSearch_OnClick(ByVal sender As Object, ByVal e As EventArgs)
            Dim objConnection As OleDbConnection
            Dim objCommand As OleDbCommand
            Dim objAdapter As OleDbDataAdapter
            Dim objDataSet As DataSet
            Dim strSearch As String
            Dim strDBQuery As String

            strSearch = txtSearch.Text
      
            If Len(Trim(strSearch)) > 0 Then

                objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Database=banyuleTESTone.mdb;")
                strDBQuery = "SELECT [Area Name] " & "FROM Areas " & "WHERE [Area Name] LIKE '%" & Replace(strSearch, "'", "''") & "%' " & "ORDER BY [Area Name];"
                objCommand = New OleDbCommand(strDBQuery, objConnection)
                objAdapter = New OleDbDataAdapter(objCommand)
                objDataSet = New DataSet()
                objAdapter.Fill(objDataSet)
                dgSearch.DataSource = objDataSet
                dgSearch.DataBind()
                objConnection.Close()
            Else
                txtSearch.Text = "Enter Search Here"
            End If
        End Sub
    </script>
    <html>
    <head>
      <title>Database Search</title>
    </head>
    <body>
    <form id="Form1" runat="server">
    <p>Search database for area (% returns all)</p>
    <asp:TextBox id="txtSearch" runat="server" />
    <asp:Button id="btnSearch" runat="server"
     Text    = "Search"
     OnClick = "btnSearch_OnClick"
    />
    <asp:DataGrid id="dgSearch" runat="server"
     HeaderStyle-Font-Bold="True"
    />
    </form>
    <hr />
    </body>
    </html>

    Visual Web Developer 2008 Express isn't showing any errors, but when I try to run it...

    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.

    Line 22:             objAdapter = New OleDbDataAdapter(objCommand)
    Line 23:             objDataSet = New DataSet()
    Line 24:             objAdapter.Fill(objDataSet)
    Line 25:             dgSearch.DataSource = objDataSet
    Line 26:             dgSearch.DataBind()


    Source File: C:\Tom02\TESTS\testSiteONE\testSiteONE\testSiteONE\Default.aspx    Line: 24

    Stack Trace:

    [OleDbException (0x80004005): Could not find installable ISAM.]
       System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +968297
       System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +86
       System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +29
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +4861516
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
       System.Data.OleDb.OleDbConnection.Open() +40
       System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31
       System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +94
       ASP.default_aspx.btnSearch_OnClick(Object sender, EventArgs e) in C:\Tom02\TESTS\testSiteONE\testSiteONE\testSiteONE\Default.aspx:24
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    

     

     

     

    Wednesday, June 30, 2010 11:14 PM

Answers

All replies