Results 1 to 24 of 24

Thread: Making a Database

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Making a Database

    how hard would it be to make your own Database? Not like a database inside of MySQL/MSSQL, but like your own db system?
    My usual boring signature: Something

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Making a Database

    Why re-invent the wheel? If its a matter of price then use Access as its free to distribute its databases and the MDAC runtimes.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Making a Database

    Sounds more like a challenge then anything.

    In which case, a data store is a data store. You can make it as simple as a txt or dat file (or some custom extension if you want) that you read yourself. How you read it, index it and access it is all you'll be building. The "database" aspect is sickeningly easy... All the tools you use with it is where it gets fun.

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Making a Database

    A DBMS comes in several layers. At the top is the API; at the bottom, the storage engine. The fun stuff is everything in between.

    I imagine you could build a simple one very easily, as sevenhalo suggests. Sounds like a good learning exercise and something I wouldn't mind doing myself if I had the time.

  5. #5

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Making a Database

    Quote Originally Posted by RobDog888
    Why re-invent the wheel? If its a matter of price then use Access as its free to distribute its databases and the MDAC runtimes.
    it is really just to see how hard it would be and maybe i might make a really small one, just for fun
    My usual boring signature: Something

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Making a Database

    Then just use a textfile or an in file.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Making a Database

    Quote Originally Posted by RobDog888
    Then just use a textfile or an in file.
    That is the easy way out.

    Go for it dclamp...see what you come up with.

  8. #8

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Making a Database

    I will. i will start it today... now, how should i go about making it...?
    My usual boring signature: Something

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Making a Database

    I've no idea....I've never made a database.

    What were some of your original ideas?

    Lets talk this through.

  10. #10

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Making a Database

    lol i have no original ideas. lol It just came to mind like 7 secondes before posting this thread.

    Rob will know what to do... where ever he is..

    I think i would have to make it in VB. Probably .NET...
    My usual boring signature: Something

  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Making a Database

    I guess I have ESP now

    Some of the older db systems used a series of text files and / or ini files. You could do that but its hard to manage and not very scaleable.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Making a Database

    Here is a very cool feature to build into your database.

    Create an internal list of reserved words and don't let people use those words as field names.

    Someone should suggest that to Microsoft, Oracle, MySQL, and anyone else that makes a database used in production apps.

  13. #13
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Making a Database

    Quote Originally Posted by Hack
    Create an internal list of reserved words
    They all have that (well, the 'popular' DBMS's do anyway).
    and don't let people use those words as field names.
    Not surprisingly, I also wish they did that!

    It's something that comes up far too often.. hence the automatic checker I wrote (link in my sig).

    Quote Originally Posted by dclamp
    lol i have no original ideas.
    What ideas do you have? What functionality do you want?

    Bear in mind that to make something with a decent amount of speed or functionality will take a long time.. and the less forward-planing you do, the worse that will be.

  14. #14
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Making a Database

    The first part is to create the ISAM portion.

    You need a place to store data records.

    You need a place to store index data.

    Index data needs to be binary-searchable.

    This is all very easy - we've done this on mainframes 25 years ago.

    So basically - you need four functions.

    Create_Database

    Create_Table

    Put_Record

    Get_Record

    Get started

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  15. #15

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Making a Database

    do i need an IDE for it?

    i guess i will be storing it in a text file. Lets start with how i am going to store it first...

    how should it be stored, one table per file, one database per file, one record per file...?
    My usual boring signature: Something

  16. #16
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Making a Database

    A table creation is basically a pile of metadata (column count, each column datatype, size, etc...)

    You can store each tables-metadata in a single file or store each tables-metadata at the "head" of the single-database file.

    Since we are being modern (post-1950) I would suggest that each tables-metadata is stored in a single file.

    So the basic initial layout of your database file is something like this (very rudimentary - but you should get the idea)

    Code:
    (word)	Number of Tables
    
    ... repeated for each table
    (word)	Number of Columns
    (xxx)	Name of Table
    
    ... repeated for each column
    (word)	size of column-definition
    (word)	Starting Byte
    (word)	Size of Column
    (word)	Datatype
    (word)	Size of column name
    (xxx)	Column name
    All these "blocks" of memory/data are repeated for each column and for each table that is defined.

    The Create_Database and Create_Table functions create/initialize/modify this part of the file.

    This would be the first part to accomplish.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  17. #17

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Making a Database

    ok. now what language should i write it in? I was told that i should do it in C, but i dont know a lick of C. would VB.NET be ok for it?
    My usual boring signature: Something

  18. #18
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Making a Database

    The two functions we are talking about - Create_Database and Create_Table could be written in fortran or cobol for all it matters - just write them!

    It only matters what language you develop the "execution" functions in - and you are miles away from that


    btw - our EXECUTION functions on the mainframe were written in VAX-11 BASIC first and them migrated to assembler/machine code...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  19. #19
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Making a Database

    I wouldnt think it would make any real difference between VB 6 or .NET but if you write it in C++ your in for a hughe headache lol.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  20. #20

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Making a Database

    i think this is going to be more then i am in for...
    My usual boring signature: Something

  21. #21
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Making a Database

    Quote Originally Posted by dclamp
    i think this is going to be more then i am in for...
    You break easy

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  22. #22

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Making a Database

    lol yeah!
    My usual boring signature: Something

  23. #23
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Making a Database

    Then if you have given up you might as well mark your thread as Resolved from the Thread Tools menu so other members will know its solved.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  24. #24

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Making a Database

    well maybe some one will come along and make it for me... lol ok i will do that.
    My usual boring signature: Something

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width