Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7791821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:00:38+00:00 2026-06-01T22:00:38+00:00

I have a sqlite database that I did not create myself but from a

  • 0

I have a sqlite database that I did not create myself but from a trusted source that resides in a folder called ‘database’. This folder is stored inside another folder in my localhost folder.

However, the error I am receiving when i’m trying to run a simple application is this:

SQLSTATE[HY000] [14] unable to open database file

Does anyone know what this is referring to? I doubt it’s my code but here it is:

pdo.class.php

class pdoClass {
// private statics to hold the connection
private static $dbConnection = null;

// make the next 2 functions private to prevent normal
// class instantiation
private function __construct() {
}
private function __clone() {
}

public static function getConnection() {
    // if there isn't a connection already then create one
    if ( !self::$dbConnection ) {
        try {
        self::$dbConnection = new PDO('sqlite:/database/library.sqlite');
        self::$dbConnection->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
        }
        catch( PDOException $e ) {

            echo $e->getMessage();
        }
    }
    // return the connection
    return self::$dbConnection;
}

}

?>

This is then referenced by another class that requires this one to output any sql data into XML format. Any help to why my sqlite database doesn’t seem to want to open is greatly appreciated (the file is set to read & write).

Thanks
Tim

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:00:39+00:00Added an answer on June 1, 2026 at 10:00 pm

    The code looks good, my feeling is that the problem is with path /database/library.sqlite

    This is an absolute path. So il will search database directory in the root directory of the filesystem is that what you want? or maybe databse is a directory a the same level of your running script? in that case sqlite:database/library.sqlite’

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pre-made SQLite database that I am downloading from the net via
I have an app that must get data from the Sqlite database in order
I get a android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that
I have a SQLite database that contains a huge set of log messages. I
I have a sqlite database which is opened in :memory: that needs to be
I have an app that creates a SQLite database ( with 24 records ),
I have a component that i want to store to an SQLite database. public
I have a datalogging application (c#/.net) that logs data to a SQLite database. This
i have set up an SQLite database. it seems that when i run a
I have a database file that is generated on a PC using Sqlite. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.