Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt.

Last post 03-31-2008 5:46 PM by Mikesdotnetting. 3 replies.

Sort Posts:

  • Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt.

    03-30-2008, 9:45 PM

    Hiiiiiiiiiiiiii,

    I've problem with my program, after i want insert data i got error "Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt." For connection i using this code 
    
    

     1    Imports System.Data
    2    Imports System.Data.OleDb
    3   
    4    Namespace AccessData
    5   
    6        Public Class DatabaseConnection


    8            Dim conect As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\" + ServerName + "\data\HelpDesk\HelpDesk_Data.mdb;Jet OLEDB:Database Password=HELPDESK; ") 'OleDbConnection   From Microsoft
    9            Public Function open() As OleDbConnection
    10               conect.Open()
    11               Return conect
    12           End Function
    13  
    14           Public Function
    close() As OleDbConnection
    15               conect.Close()
    16               Return conect
    17           End Function
    18  
    19       End Class
    20  
    21   End Namespace

     

    Please advise..

    Thanks

  • Re: Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt.

    03-30-2008, 10:43 PM
    Answer
    • All-Star
      90,719 point All-Star
    • SGWellens
    • Member since 01-02-2007, 4:27 PM
    • Twin Cities, MN
    • Posts 7,408
    • Moderator
      TrustedFriends-MVPs

    Boedax's Malay:
    after i want insert data i got

    Does that mean you can read from the database and have a problem inserting?

    If so, it may be that the application (IIS) does not have write permissions to the file/directory on the server. 

    Can you open and manipulate the data with MSAccess?

    Steve Wellens

    My blog
  • Re: Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt.

    03-30-2008, 11:34 PM

    SGWellens:

    Boedax's Malay:
    after i want insert data i got

    Does that mean you can read from the database and have a problem inserting?

    If so, it may be that the application (IIS) does not have write permissions to the file/directory on the server. 

    Can you open and manipulate the data with MSAccess?

    I can read data before inserting. then i give permission to everyone.

    also i can open and manipulate data directly in access..

    Thanks

  • Re: Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt.

    03-31-2008, 5:46 PM
    Answer

    Compact and Repair the database first.  If that doesn't fix it, you may have to re-install Jet. http://www.microsoft.com/downloads/details.aspx?familyid=2deddec4-350e-4cd0-a12a-d7f70a153156&displaylang=en

     

    Regards Mike
    [MVP - ASP/ASP.NET]
    My site    Please help - URGENT!!!    What ASP.NET can and can't do
Page 1 of 1 (4 items)