internal static SchemaDefinition GetSchema(string DBLocation)
        {
            DatabaseName = DBLocation;

            SchemaDefinition sd = new SchemaDefinition();

            //SchemaDefinitions is a consideration for future use.  For the time being
            //Clear it before adding a new schema
            SchemaDefinitions.Clear();

            FileInfo f = new FileInfo(DBLocation);

            if (!f.Exists)
            {
                LastError = "Database not found."; sd.LoadStatus = -1; return(sd);
            }

            if (DataAccess.IsEncrypted(DBLocation))
            {
                GetPassword gp = new GetPassword
                {
                    DBLocation = DBLocation
                };
                gp.ShowDialog();
                if (gp.Cancelled)
                {
                    sd.LoadStatus = -1; return(sd);
                }
                sd.password = gp.Password;
            }
            else
            {
                sd.password = null;
            }

            sd.DBLocation = DBLocation;
            sd.DBName     = f.Name;
            sd.DBSize     = f.Length;
            sd.CreateDate = f.CreationTime;
            sd.LastUpDate = f.LastWriteTime;
            sd.LastAccess = f.LastAccessTime;
            SchemaDefinitions.Add(DBLocation, sd);

            SQLiteConnection conn = null;
            SQLiteCommand    cmd  = null;

            if (!OpenDB(DBLocation, ref conn, ref cmd, out SQLiteErrorCode returnCode))
            {
                sd.LoadError = returnCode; sd.LoadStatus = -1; return(sd);
            }

            sd.Tables   = GetTables(cmd);
            sd.Views    = GetViews(cmd);
            sd.Triggers = GetTriggers(cmd);

            CloseDB(conn);
            sd.LoadStatus = 0;
            sd.LoadError  = SQLiteErrorCode.Ok;
            SchemaDefinitions[DBLocation] = sd;
            return(sd);
        }