I am hoping to write a program to help me cataloge my toy collection, which all being well I want to share (the program) one day. My idea on how to do what I want is basically this:
I need two databases of some sorts, one (called for example "Toy.db") which holds a record of all the toys and accessories out there. The other called "User.db", which stores which ones the user has and some additional user information on them.
When you add a new record you select from a list of possible toys (and accessories for each entry) generated from Toy.db, a reference number to that toy and some additional user information is then stored into User.db . When you display an entry, the information for that toy is taken from Toy.db and displayed with the extra user information on screen - thus making a personal entry for that toy showing what you have.
I know Pure Basic can handle databases generated with Microsoft Access (which I use at work). So I wonder would it best to create the databases in this format or too create my own unique format instead. Idealy I need something that is at least semi-secure (via either encryption or password protection) so that the databases cannot be edited directly and only by me (so I can issue offical updates/corrections as needed).
Could someone tell me what they think is the best way of doing this as I have never tried to create a database program before and I don't want to start on one path and then hit a brick wall stopping things and me in the process.
Any thoughts on the best way to approach this is appreicated.
Thanks
Andy
Database Question.
Database Question.
Real Power Comes From Sharing It With Those Who Think They Have It All.
Why 2 databases? Would not a single database with two tables do the job?
Anyhow, with PB you have a number of options re: databases. First you could use a simple text file or xml. No problems there. There are a few user libraries floating around for using xml, -saves coding your own parser!
Secondly, Purebasic's internal DB commands which rely on ODBC are simple enough to use. Not my favourite method as there can be some fuffing around on the target machines to ensure the correct drivers are present.
Stepping up, there are a couple of cool libraries floating around which allow you to access databases through OLE. This is a slick method and whilst still relying upon Microsoft's MDAC, there isn't too much of a problem regarding deployment these days.
And then there's my personal favourite: SQLite! You can't beat it for desktop applications. It comes in the form of a very small and compact dll and it is blisteringly fast and very robust. Do a search on these forums and you'll find loads of code snippets and some include files which take the hassle out of linking with the SQLite dll. If you're used to dealing with MS Access .mdb files then you'll have no probs with SQLite.
www.sqlite.org
Regards.
Anyhow, with PB you have a number of options re: databases. First you could use a simple text file or xml. No problems there. There are a few user libraries floating around for using xml, -saves coding your own parser!
Secondly, Purebasic's internal DB commands which rely on ODBC are simple enough to use. Not my favourite method as there can be some fuffing around on the target machines to ensure the correct drivers are present.
Stepping up, there are a couple of cool libraries floating around which allow you to access databases through OLE. This is a slick method and whilst still relying upon Microsoft's MDAC, there isn't too much of a problem regarding deployment these days.
And then there's my personal favourite: SQLite! You can't beat it for desktop applications. It comes in the form of a very small and compact dll and it is blisteringly fast and very robust. Do a search on these forums and you'll find loads of code snippets and some include files which take the hassle out of linking with the SQLite dll. If you're used to dealing with MS Access .mdb files then you'll have no probs with SQLite.
www.sqlite.org
Regards.
I may look like a mule, but I'm not a complete ass.
- Thorsten1867
- Addict

- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
You find a good Wrapper for SQLite3-DLL in PBOSL:
http://pbosl.purearea.net/index.php?site=Libs
http://pbosl.purearea.net/index.php?site=Libs

