locked
AccessFile and Jet provider RRS feed

  • Question

  • User326276446 posted

    Hi

    I have made a little webservice that works fine on a free hosting server and on my local IIS.

    In this days I had configured a new server with IIS, it works ok but i have a lot of trouble with Microsoft.Jet.OleDb.4.0.

    I have this error in the stack:

    [Exception: AccessFile is not valid: C:\Users\another\Desktop\progetto\Provider=Microsoft.Jet.OleDb.4.0;Data Source=~\App_Data\ASPNetDB.mdb;Persist Security Info=True]
       Samples.AccessProviders.AccessConnectionHelper.EnsureValidMdbFile(String fileName) +231

    EnsureValidMdbFile:

            private static void EnsureValidMdbFile(string fileName) {
                OleDbConnection conn = null;
                try {
                    conn = new OleDbConnection(s_connPrefix + fileName);
                    conn.Open();
                } catch {
                    throw new Exception("AccessFile is not valid: "+fileName);
                }
                finally {
                    if (conn != null)
                        conn.Close();
                }
            }

    I dont know if the problem is on Microsoft.Jet.OleDb.4.0 or with some directory's autorizations.... maybe is the jet.oledb....

    Suggestions?

    Tuesday, November 15, 2011 3:10 PM

Answers

  • User3866881 posted

    After some test i have found the "big" problem about jet's provider: The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

    Maybe it will cause a lot of problems... i will do a googling to risolve it.

    If you have any suggestions....

    First I'd say that if this problem is the "murder" of your problem——Haha……

    1)Install Office 2003 version.

    2)WindowsXP-KB829558-x86-ENU.exe

    Download here by clicking it

    For more info at:

    http://support.microsoft.com/kb/239114/en-us

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 16, 2011 9:38 PM

All replies

  • User-821857111 posted

    Instead of assuming that the "Access file is not valid" in your exception handling, why not generate the actual error message from the exception? At least that will save you (and us) having to guess what the problem is:

      private static void EnsureValidMdbFile(string fileName) {
    OleDbConnection conn = null;
    try {
      conn = new OleDbConnection(s_connPrefix + fileName);
      conn.Open();
    } catch(Exception ex) {
      //do something with ex.Message
    }
    finally {
      if (conn != null)
      conn.Close();
                }
    }

    By the way, that file path in the stack trace is not correct. What connection string are you using?

    Wednesday, November 16, 2011 2:35 AM
  • User326276446 posted

    By the way, that file path in the stack trace is not correct. What connection string are you using?

    This is my actual connection string:

      <add name="AccessFileName" connectionString="Provider=Microsoft.Jet.OleDb.4.0;Data Source=~\App_Data\ASPNetDB.mdb;Persist Security Info=True"/> 

    But when i use |DataDirectory|:

    <add name="AccessFileName" connectionString="Provider=Microsoft.Jet.OleDb.4.0;Data Source=|DataDirectory|\ASPNetDB.mdb;Persist Security Info=True"/>

      I have this error:

    [ArgumentException: Caratteri non validi nel percorso.]
       System.IO.Path.CheckInvalidPathChars(String path) +10074526
       System.IO.Path.IsPathRooted(String path) +23
       Samples.AccessProviders.AccessConnectionHelper.BuildConnectionForFileName(String dbFileName) +284
       Samples.AccessProviders.AccessConnectionHelper.GetConnection(String dbFileName, Boolean revertImpersonation) +205
       Samples.AccessProviders.AccessMembershipProvider.ValidateUser(String username, String password) +182
       System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +75
       System.Web.UI.WebControls.Login.AttemptLogin() +152
       System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +124
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981
    
    

    After some test i have found the "big" problem about jet's provider: The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

    Maybe it will cause a lot of problems... i will do a googling to risolve it.

    If you have any suggestions....

    Wednesday, November 16, 2011 6:36 AM
  • User3866881 posted

    After some test i have found the "big" problem about jet's provider: The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

    Maybe it will cause a lot of problems... i will do a googling to risolve it.

    If you have any suggestions....

    First I'd say that if this problem is the "murder" of your problem——Haha……

    1)Install Office 2003 version.

    2)WindowsXP-KB829558-x86-ENU.exe

    Download here by clicking it

    For more info at:

    http://support.microsoft.com/kb/239114/en-us

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 16, 2011 9:38 PM
  • User326276446 posted

    First I'd say that if this problem is the "murder" of your problem——Haha……

    yeah yeah! you're rigt! i had changed an option on IIS for forcing a 32bit applications and it works....

    Thursday, November 17, 2011 4:04 AM