Results 1 to 12 of 12

Thread: sqlite: Database seems to be corrupted

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2016
    Posts
    510

    sqlite: Database seems to be corrupted

    Hello
    I'm using SQLite as backend with VbrichClient.
    Suddenly I'm getting this message on opening the application:cannot compile sql statement file is not a database.
    Did anyone experience this issue?
    Is there a way to solve the problem?
    thank you

  2. #2
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,599

    Re: sqlite: Database seems to be corrupted

    Can you post the database file, or does it contain private information?

  3. #3
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,599

    Re: sqlite: Database seems to be corrupted

    Also - were you using a password for the database, and if so - are you sure you are still using the same password to open it?

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2016
    Posts
    510

    Re: sqlite: Database seems to be corrupted

    Quote Originally Posted by jpbro View Post
    Also - were you using a password for the database, and if so - are you sure you are still using the same password to open it?
    thank you sir
    yes it is the same password.
    Please sir check your inbox. the file was sent in private message.

  5. #5
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,599

    Re: sqlite: Database seems to be corrupted

    I took a look at the file you sent - it appears to be an HTML document, not an SQLite database. When I open it up, it looks like a Google login page.

    Just a hunch: does your app grab your database from Google Drive and store it locally? It looks like it may have failed due to requiring authentication and you saved the HTML file over top your database file.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2016
    Posts
    510

    Re: sqlite: Database seems to be corrupted

    Thank you sir
    I took a look at the file you sent - it appears to be an HTML document, not an SQLite database. When I open it up, it looks like a Google login page.
    But when I look at the file property, I has a "db" extension: SQLite database (.db)
    does your app grab your database from Google Drive and store it locally?
    No the database is at the application path.
    thanks

  7. #7
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    1,063

    Re: sqlite: Database seems to be corrupted

    Quote Originally Posted by Mustaphi View Post
    But when I look at the file property, I has a "db" extension: SQLite database (.db)
    The extension of the file is completely irrelevant. If I have a bicycle and put a post-it note on it that says spaceship, that doesn't mean I can fly it to the moon.

    If I create a text file that contains the text "This is a picture of a Palm Tree" and change the name to PalmTree.jpg, does that make it valid image file? Of course not.

    Did you examine the contents of your db file in something like Notepad? If, as jbpro saw in your attachment, your local file is just a bunch of html, then your database file needs to be restored from backup because it has been overwritten, replaced, or significantly corrupted due to some sort of hard drive issue.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2016
    Posts
    510

    Re: sqlite: Database seems to be corrupted

    OptionBase1
    thank you that clear
    unfortunately there is no backup copy of the database file.

  9. #9
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,599

    Re: sqlite: Database seems to be corrupted

    I'm afraid it's really bad news if you don't have a backup. Unless Google is mangling the DB at the link you sent me, it clearly looks like Google HTML code for their login page:

    Result in Notepad++:

    Attachment 177740

    Result in browser:

    Attachment 177741

    Perhaps a user accidentally saved over the database file with the HTML?

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2016
    Posts
    510

    Re: sqlite: Database seems to be corrupted

    Aanyway thank you sir

  11. #11
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,913

    Re: sqlite: Database seems to be corrupted

    there is no backup copy of the database file
    bad management?
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  12. #12
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    2,047

    Re: sqlite: Database seems to be corrupted

    Here is how to attempt broker sqlite DB repair with their sqlite3.exe utility from command prompt

    c:> echo .dump | sqlite3.exe my.db > dump.sql
    c:> echo .quit | sqlite3.exe -init dump.sql my_repaired.db

    cheers,
    </wqw>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width