NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 43 44 45 46 47 … 93 Next »
how to access gbpvr.db3 file using SQLite

 
  • 0 Vote(s) - 0 Average
how to access gbpvr.db3 file using SQLite
Wakalaka
Offline

Posting Freak

Posts: 926
Threads: 161
Joined: Jan 2007
#1
2007-05-05, 12:37 PM
Using Finisar.SQLite DLLs here.

I have a simple C# program to output the capture sources
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Finisar.SQLite;

namespace sqltest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SQLiteConnection sqconn;
            string dbpath = "c:\\temp\\gbpvr.db3";
            string strconn = "Data Source=" + dbpath + ";Version=3;";
            sqconn = new SQLiteConnection(strconn);
            sqconn.Open();

            int i = 1;
            bool result = false;
            do
            {
                string strSQL = "SELECT * FROM CAPTURE_SOURCE WHERE oid='" + i.ToString() + "'";
                SQLiteCommand sqc = new SQLiteCommand(strSQL, sqconn);
                SQLiteDataReader sqr = sqc.ExecuteReader();
                result = sqr.Read();
                if (result)
                {
                    int alloc_order = (int) sqr["allocation_order"];
                    listBox1.Items.Add(alloc_order.ToString() + " " + sqr["name"]);
                    i++;
                }
            } while (result);
            sqconn.Close();
        }
    }
}

I added a reference to SQLite.Net.dll. When I run the program, I get an exception on sqconn.Open(). Any idea what I have wrong?
NPVR 4.1.0.180302 o Kodi 17.6 o EventGhost 0.5.0.rc4 o SAF 6.3.2 o SchedulesDirect
[SIZE="1"]
Case: Apevia X-Qpack HTPC o Motherboard: Asus P8H67-MLE o CPU: Intel Core i3-2100 o RAM: 8 GB o OS: Win7 64-bit
Tuner: HDHomeRun dual tuner o Leaf SkyHDTV antenna o Remote: Microsoft MCE
Hard drives: Samsung 500 GB SSD, Seagate 2 TB SATA2, Samsung 540 GB SATA2 o Input: Logitech USB keyboard & mouse
Video: ATI Radeon 7750 o Monitor: Viewsonic 27" VX2703MH-LED, LG 55" LCD TV
[/SIZE]
Wakalaka
Offline

Posting Freak

Posts: 926
Threads: 161
Joined: Jan 2007
#2
2007-05-05, 01:34 PM
Solved the problem. A search on the SourceForge forums for Finisar.SQLite revealed this. I grabbed the latest SQLite3.dll from sqlite.org and my program now works (with a slight mod).
Code:
if (result)
{
   int alloc_order = (int) ((Int64) sqr["allocation_order"]);
   listBox1.Items.Add("alloc[" + alloc_order.ToString() + "] oid[" + i.ToString() + "] " + sqr["name"]);
   i++;
}
NPVR 4.1.0.180302 o Kodi 17.6 o EventGhost 0.5.0.rc4 o SAF 6.3.2 o SchedulesDirect
[SIZE="1"]
Case: Apevia X-Qpack HTPC o Motherboard: Asus P8H67-MLE o CPU: Intel Core i3-2100 o RAM: 8 GB o OS: Win7 64-bit
Tuner: HDHomeRun dual tuner o Leaf SkyHDTV antenna o Remote: Microsoft MCE
Hard drives: Samsung 500 GB SSD, Seagate 2 TB SATA2, Samsung 540 GB SATA2 o Input: Logitech USB keyboard & mouse
Video: ATI Radeon 7750 o Monitor: Viewsonic 27" VX2703MH-LED, LG 55" LCD TV
[/SIZE]
HydroChronic
Offline

Member

Posts: 106
Threads: 23
Joined: Jan 2007
#3
2007-05-05, 01:54 PM
Can this same package be used to read Recording information from gbpvr.db3? I have been unable to get it to work using the Common GBPVR Utilities dll and the feature would be extremely helpful for those people who don't rename their recording files.
Jeff
Offline

Posting Freak

Posts: 1,933
Threads: 69
Joined: Oct 2004
#4
2007-05-05, 02:04 PM
You can use the dll that gbpvr itself uses, System.Data.SQLite.dll.

Documentation is available at http://sqlite.phxsoftware.com/

Just be careful that you don't install a newer version of the dll on your machine. It can break things if you are not familiar with how to manage multiple versions of .dot assemblies.

As to you other comment, what problem are you having using the commongbpvrutilites.dll?

Jeff
Wakalaka
Offline

Posting Freak

Posts: 926
Threads: 161
Joined: Jan 2007
#5
2007-05-05, 08:38 PM
Jeff Wrote:You can use the dll that gbpvr itself uses, System.Data.SQLite.dll.

Documentation is available at http://sqlite.phxsoftware.com/

Just be careful that you don't install a newer version of the dll on your machine. It can break things if you are not familiar with how to manage multiple versions of .dot assemblies.

ok, will try it out.
NPVR 4.1.0.180302 o Kodi 17.6 o EventGhost 0.5.0.rc4 o SAF 6.3.2 o SchedulesDirect
[SIZE="1"]
Case: Apevia X-Qpack HTPC o Motherboard: Asus P8H67-MLE o CPU: Intel Core i3-2100 o RAM: 8 GB o OS: Win7 64-bit
Tuner: HDHomeRun dual tuner o Leaf SkyHDTV antenna o Remote: Microsoft MCE
Hard drives: Samsung 500 GB SSD, Seagate 2 TB SATA2, Samsung 540 GB SATA2 o Input: Logitech USB keyboard & mouse
Video: ATI Radeon 7750 o Monitor: Viewsonic 27" VX2703MH-LED, LG 55" LCD TV
[/SIZE]
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#6
2007-05-05, 08:53 PM
Wakalaka Wrote:ok, will try it out.

I have also discovered a really good dll that lets one use VB6. That appeals to us old farts...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
HydroChronic
Offline

Member

Posts: 106
Threads: 23
Joined: Jan 2007
#7
2007-05-06, 12:42 AM
Jeff Wrote:As to you other comment, what problem are you having using the commongbpvrutilites.dll?

Jeff

My ultimate goal was being able to replace the file names in my file list with the Recording info (ie. Show Name, Episode Name and channel number) for files recorded by GBPVR. I tried to do this when I first started writing the plugin using the ArchiveDB datatype, but I got error messages saying that I was missing the file "Video Archive.mdb" (or something along those lines). I was also unable to find any documentation pertaining to how to change the database file which is referenced by that datatype. I had put this problem to the side in order to finish the functionality of the plugin, but now that is done and I am back to this problem again.
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#8
2007-05-06, 06:45 PM
HydroChronic Wrote:My ultimate goal was being able to replace the file names in my file list with the Recording info (ie. Show Name, Episode Name and channel number) for files recorded by GBPVR. I tried to do this when I first started writing the plugin using the ArchiveDB datatype, but I got error messages saying that I was missing the file "Video Archive.mdb" (or something along those lines). I was also unable to find any documentation pertaining to how to change the database file which is referenced by that datatype. I had put this problem to the side in order to finish the functionality of the plugin, but now that is done and I am back to this problem again.

Interesting how there are a few of us working on the same type of program.

Originally there was renamerecording.exe. And then there was addepisode.exe.

I've just completed one that, after getting the info from the database, also gets season info from the net (epguides.com) and uses that to build the new file name...

I may not have worked on it, if I had known there were others doing the same... But it's all good :-)
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#9
2007-05-06, 06:50 PM
For anyone still using VB6, I have some source and the wrapper dll that makes accessing the gb-pvr db3 file very easy to access...

I've modified the source a bit to also handle Unicode to UTF-8 and back encoding/decoding so that other languages besides English can also be referenced...

If you interested check it out...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
HydroChronic
Offline

Member

Posts: 106
Threads: 23
Joined: Jan 2007
#10
2007-05-07, 03:48 AM
zehd Wrote:Interesting how there are a few of us working on the same type of program.

Originally there was renamerecording.exe. And then there was addepisode.exe.

I've just completed one that, after getting the info from the database, also gets season info from the net (epguides.com) and uses that to build the new file name...

I may not have worked on it, if I had known there were others doing the same... But it's all good :-)

The plugin I am currently working on deals with manually editing commercials in a comskip txt file. But since I expect the user to include their Recordings folder as one of the folders where files are selected from, I would like to be able to give the user more than just the file name with the show name and various numbers.

You say that you just completed a tool which gets information from GBPVR's database. How did you go about doing that, since that is basically what I am trying to do.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  NextPVR 5: When is PIN Required for API Access? pkscout 3 2,841 2020-05-26, 04:45 AM
Last Post: sub
  API access to artwork and deleting recordings cncb 29 16,064 2016-11-06, 02:20 AM
Last Post: mvallevand
  How Does "Use S01E01 File naming format if possible" work puck64 7 5,526 2015-08-25, 10:21 AM
Last Post: puck64
  TitanTv Remote Schedule For GBPVR UncleJohnsBand 51 34,538 2015-08-20, 05:11 PM
Last Post: sub
  NEWA - using buffer file produced by /public/VLCService?Channel= bgowland 5 2,950 2014-01-02, 06:36 AM
Last Post: bgowland
  Is the input file for pvrx2.exe -import unique to NextPVR? spinnaker 1 1,831 2013-10-08, 02:25 AM
Last Post: sub
  Accessing music file metadata in C# bgowland 6 3,452 2013-01-26, 05:14 AM
Last Post: bgowland
  Access 'Stay on top' setting from a plugin? McBainUK 5 2,497 2011-11-07, 04:43 PM
Last Post: sub
  Roku & GBPVR pvruser 16 11,665 2011-10-16, 08:31 PM
Last Post: pvruser
  Access ImportHDPVRChannelsForm mvallevand 62 15,792 2011-08-09, 03:37 AM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode