Author Topic: Steve's Guide to Databases v0.1 (WIP)  (Read 55 times)

SMcNeill

  • Hero Member
  • *****
  • Posts: 2404
    • Email
Steve's Guide to Databases v0.1 (WIP)
« on: April 20, 2013, 01:50:17 PM »
This is definitely a work-in-progress, and the finished guide probably won't be ready for several weeks; but I thought I'd share it as I go along so others who might could purview it and see if it reads simply enough, needs clarification, or revision.  Any questions or insights to share as I go along with this will be appreciated.    For now, this is being written in WORD 2012 docx format, but it should convert easily in case anyone needs differently for their personal use.  When I finish it all up, I'll try and get some nice open office, text, and word document formats converted out of it so that it'll be something anyone could download and read up on easily.

What I'm hoping to do here is start with the true basics for a complete beginner, and then expand the concepts of advanced database management as I go along and expand as we go.  Take a look, see if this seems like the proper place to start the tutorial, offer any feedback and thoughts (even URE SPELIN SUX!), and I'll make adjustments as I go.  Once it's all finished, I'll wrap it up nice and neat and add it to the tutorial section for future reference from anyone who comes and visits the site.  ;)
« Last Edit: April 21, 2013, 12:10:26 PM by SMcNeill »
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files

OlDosLover

  • Hero Member
  • *****
  • Posts: 3845
  • OlDosLover
    • Email
Re: Steve's Guide to Databases v0.1 (WIP)
« Reply #1 on: April 21, 2013, 11:01:46 AM »
Hi all,
    Good simple clear example Steve. I never thought of adding in my own EOD and place it into the data statements! What a good concept that one is. Looking forward to reading more of this. Keep the good work up.
OlDosLover.

codeguy

  • Hero Member
  • *****
  • Posts: 3539
  • what the h3ll did i name that code?
    • stuff at dkm
    • Email
Re: Steve's Guide to Databases v0.1 (WIP)
« Reply #2 on: April 21, 2013, 12:03:29 PM »
i would suggest use of redim _preserve, perhaps increasing upperbound limits by 10% each time (there is an example of this in http://www.qb64.net/forum/index.php?topic=1565.msg17025#msg17025). while this is marginally slower, it is VASTLY more flexible than hardcoded array bounds. other than that, this is a good primer for the beginner. when ya get to sorting and searching, gosh ya have TONS of nice little algos contributed to qb64 to choose from.
http://denteddisk.forums-free.com/make-an-appointment-with-the-resident-code-guru-f34.html

SMcNeill

  • Hero Member
  • *****
  • Posts: 2404
    • Email
Re: Steve's Guide to Databases v0.1 (WIP)
« Reply #3 on: April 21, 2013, 12:29:17 PM »
Sorry if this post seems out of whack -- my mouse died, and I'm trying to navigate and type using TAB to swap between things in my browser.  LOL - I never realized what a challenge this could be, nor how much we take a mouse/trackball for granted!!

Codeguy - I'll get more into little tricks and optimizations like what you suggest a little later into the process.  For now, I'm trying to keep things simple, and then slowly expand upon getting and retrieving our data more than I am in the best way to work with our arrays.  For now, I think I've more of less covered how someone can use DATA, READ, and RESTORE to hard-code information into a program and get it back.   (I've updated to a slightly newer version of the guide, but the version number doesn't reflect that yet.  Without a mouse, it's just a pain to SAVE AS and a simple quick-key combo to SAVE a file...)

The next thing I'm going to introduce is OPEN, FOR INPUT, FOR OUTPUT, FOR APPEND, FOR RANDOM, FOR BINARY, AS #, CLOSE, KILL.  (With a nice reference to FREEFILE, as well.) ;)

Then we're going to WRITE and INPUT some actual data from the disk!   

After that, we'll have most of the very basic things covered.  Then we'll get into some of the more advanced concepts -- File structure, buffers, TYPEs.    After that, then we'll try and pull it all together so that a user can create their very own dynamic databases and make use of them.   Add data, delete data, sort data....   

At the rate this is going, I think this whole little guide will end up being a 50 page creation or something insane when it's all said and done!   i'm just hoping that it doesn't grow so large that it grows intimidating...

Sometimes it's hard to find balance -- enough words to cover and teach a subject, vs. enough words that it overwhelms a subject and makes it more confusing than it needs to be.   It's the whole reason I'm sharing it as I write it: so that everyone here can help look it over and help me keep it simple, concise, and useful.   :)

I do appreciate all the feedback though guys, and I'm glad someone is learning a little something from it already.  Hopefully by the time I finish this thing up, no one will be mystified or bothered by data storage and retrieval any more.   At least that's the goal for it.  ;)
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files