Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 11-20-2006, 04:36 AM   #1 (permalink)
bakoo
Recruit
 
Join Date: Nov 2006
Posts: 2
bakoo is on a distinguished road
C Database Programming

Hey...

I need to make a Database in C... I am not to sure what the best way to do this is, it has to be in C for several reasons, mainly because its a C project, but it has to comile on Win and Lin and i am happy with making C run on both...

Anyway, i am not sure how databases in C are done. Are they done as a complete app or are they done with a text file and app or ???

I am open to help here, really need to be pointed in the right direction...

Wouldnt mind a link to a website too if there are some good how.to's

Thanks for any help
bakoo is offline   Reply With Quote
Old 11-20-2006, 11:42 AM   #2 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Why not using an existing database? SQLite is very impressive as are mysql and postgres.

If you're set on writing one yourself, realize that modern relational databases are very complicated. In general you take over a chunk of diskspace and write a "filesystem" to store the various tables and columns. You then have to be able to read them into to memory efficiently and write them back to disk in a reliable manner as they change. You also have to have a way to communicate with the database, so you'll need some client server code. Also you probably want to conform to the SQL standard.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 11-20-2006, 02:37 PM   #3 (permalink)
bakoo
Recruit
 
Join Date: Nov 2006
Posts: 2
bakoo is on a distinguished road
Hey...

I need to create a database for a programming project at College. Its just a simple phone-book and contact detail database.

Will have no more than 100 or so records, but the aim is to create your own database and not use existing database software.

I was thinking of using just a plain text file, it doesnt need to be relational. I was not to sure if this is a common standard to use a text file, or if it is easier just to create one another way.

It has to be done in C code, and it cant use any software that isn't made.

Any help again, would be appreciated, as to i appreciate the comment above, i should have made my origional post a little more clear, cheers...
bakoo is offline   Reply With Quote
Old 11-20-2006, 04:20 PM   #4 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,166
Belisarius is on a distinguished road
For lightweight databases, flat files are actually pretty common. They are frequently faster than most relational databases because the interaction is so simple.

Most common method is a CSV, or comma seperated value, file.
__________________
GitS
Belisarius is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparison of Different Programming Languages Punch-M6.net All Other Coding Languages 23 04-19-2007 01:34 PM
Need Help with C programming - I am new to C/C++ akshay19 Standard C, C++ 4 04-07-2005 10:21 AM
Implementing Run Length Encoding on Bitmaps in C Programming kodonovan_cork Standard C, C++ 0 04-21-2004 10:23 AM
For those who have Learned C from "The C Programming Lanuage" DemosthenesB Standard C, C++ 5 07-13-2003 12:22 AM


All times are GMT -8. The time now is 05:36 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting