Simple WebApp to load MS Access 2000 mdb file

Discussion in 'Databases' started by Dave, Apr 9, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello,

    I'm trying to connect a simple Access 2000 mdb file called "db1.mdb" which I uploaded to my "_database" folder and registered with the "Access ODBC Tool" with a DSN of "autogetdata_db1".

    In my local copy of VS2003 IDE, I created a connection object by dragging the connection from Server Explorer over to the page layout. This created a connection object with a local path reference (bolded):



    Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Data Source=""C:\Inetpub\DavesWebServer\WebData\db1.mdb"";Jet OLEDB:Engine Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;persist security info=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1"


    so I changed the bolded part to:


    DSN=""autogetdata_db1""


    and rebuilt the project. I then upload the web application to a new folder at my domain root, and made it into an application using the Web Application Tool.


    Needless to say, the application crashes with this err message:



    Server Error in '/WebData' 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:





    Code:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:





    Code:
    [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
       WebData.WebForm1.Button1_Click(Object sender, EventArgs e)
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain() +1292
    




    Version Information:Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300





    I guess my question really may have more to do with coding. When using the Access ODBC tool, should I perhaps be working with ODBCConnection objects instead of the OLEDBconnection objects created by VS. Also,..what is the right way to show the "path" to the database located in my _database folder,..should I use DSN=autogetdata_db1,..or should I try to code the path directly,....





    Sorry to bother you on a Sat. night,..Thanks,


    Dave<!--
    [OleDbException]: Could not find installable ISAM.
    at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
    at System.Data.OleDb.OleDbConnection.InitializeProvider()
    at System.Data.OleDb.OleDbConnection.Open()
    at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
    at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
    at WebData.WebForm1.Button1_Click(Object sender, EventArgs e)
    at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    at System.Web.UI.Page.ProcessRequestMain()
    [HttpUnhandledException]: Exception of type System.Web.HttpUnhandledException was thrown.
    at System.Web.UI.Page.HandleError(Exception e)
    at System.Web.UI.Page.ProcessRequestMain()
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    --><!--
    This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->
     
  2. My apologies. I had a brain-fart when I posted this question on Access. I should have searched the forum better.

    For others wanting to connect an Access database to their .NET application on this site please check out
    the post by Dexter Zafra on 7/42005 as well as his free code download at www.myasp-net.com

    Dextershould write a book.

    (I'll try not to post giberish error messages in the future!!)[​IMG]
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page