Creating a database (inside a GUI)

This is a discussion on Creating a database (inside a GUI) within the C Programming forums, part of the General Programming Boards category; hello all! --my friend and myself wish to create a database accesible by a GUI in which information can be ...

  1. #1
    * S T U D E N T *
    Join Date
    Oct 2003
    Posts
    30

    Lightbulb Creating a database (inside a GUI)

    hello all!

    --my friend and myself wish to create a database accesible by a GUI in which information can be entered and then viewed.

    --the user will be asked to enter lots of data and this should be appended to the database and able to be viewed in the GUI where the info can be saved!

    --can anyone help us on where to start? and does anyone know how to create/access a database in C?!

    --any ideas/help/advice etc is much appreciated,

    --Chris

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    385
    First things first.......what database?
    Wandering aimlessly through C.....

    http://dbrink.phpwebhosting.com

  3. #3
    * S T U D E N T *
    Join Date
    Oct 2003
    Posts
    30
    Well there isn't a database yet.
    We will need to store data that gets entered into the program, we intended to store it in a database somehow but if there is some other better method then we are open to suggestions.

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    You don't mention target OS or compiler.

    In C using WIN32 for the GUI this could take months/years for a simple app (unless you are already an expert in WIN32).

    MFC (C++ using MSVC) allows for fairly rapid GUI development for MS OS's. It is big and slow but resources/help are fairly easy to find on the net.

    In MFC has an ODBC record class that can be linked to an Access database. Done in a few clicks. The record sets are faily easy to use with SQL. The database can be made in Access.

    The database can be configured to use a DSN FILE or/and USER DSN to allow local network access without a line of code.


    This is probably the simplest/quickest way.........
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  5. #5
    * S T U D E N T *
    Join Date
    Oct 2003
    Posts
    30

    Unhappy

    ok ...... (tries to translate into english ... fails!)

    erm...

    what me and my friend want to do is create a program that acts like a database to store information on football matches etc

    the user inputs the home team, away team, score etc and then all of it is nicely formatted and looks beautiful in the GUI

    we will need to encorporate some sort of open & save(append) feature to it

    all we need to know is : is there actually a way of making a database in C (is there a class) as Java doesnt have a database class as far as i know!

    if not, any of those really strange non-english things will do, but can u give us some guidence on how .... exactly we start them off?!

    all help appreciated....

    --Chris & Ben

    e-mail: guyattc2@cs.man.ac.uk

  6. #6
    Registered User
    Join Date
    Oct 2002
    Posts
    98
    I think your better off not thinking in terms of your objective as a database. What you want to do is store all of the data that your GUI needs in such a way that you can retrieve it reliably.

    The best way to do that is to use a file, and just work out a way of tagging the data you write into the file so that your program knows where to put it when you retrieve it.

    So say for football data, you always write to the file a record in this format:

    home team;away team;home score;away score;date;

    then when your program reads records from the file, it knows the fields are delimited by a semi-colon, and knows that the first field is home-team etc.
    There is no such thing as a humble opinion

  7. #7
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    >>any of those really strange non-english things will do

    What strange non english things?

    >>is there actually a way of making a database in C (is there a class)

    Yes you can link to a database in C (but it is hard).

    C does not have classes (as such)

    C++ has classes.

    WIN32 is a library of extra functions for creating programms using MS Windows Operating systems. It can be used in C or C++. It is used for creating Windows style GUIs.

    MFC is MS C++ wrapper for WIN32. It is MUCH quicker to use. It can create a GUI in minutes that would take days in C with the WIN32 API.
    It has a class for databases and database records.

    >>home team;away team;home score;away score;date;

    then when your program reads records from the file, it knows the fields are delimited by a semi-colon, and knows that the first field is home-team etc.<<

    If you used commas instead of semicolons and called the file a .csv then it will open in Excel.....(comma seperated volume)
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  8. #8
    * S T U D E N T *
    Join Date
    Oct 2003
    Posts
    30

    Thumbs up

    alright cheers pal!

    those strange non-english things were all that stuff about windows! both me and my friend are 2nd yr comp sci students and have only been learning C for about a month, and so have limited knowledge! (hint why C doesn't have classes 'as such').

    looking at all those options we like the idea of the .csv file thing because we have already input a lot of the data into an excel spreadsheet!

    well im gonna let him code it, hehe, and if we have problems (which im sure we will) we will have a good little post about it!

    right,

    time to play some more championship manager!

    --Chris

    --------------------------------------------------------------------------

    (guyattc2@cs.man.ac.uk | chris@manchestercomputers.com)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. variables when declared inside or outside a function
    By jas_atwal in forum C Programming
    Replies: 6
    Last Post: 12-14-2007, 02:42 PM
  2. Still battling with Copy Control
    By Mario F. in forum C++ Programming
    Replies: 9
    Last Post: 06-23-2006, 09:04 AM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  4. How to move a sprite around inside a windows GUI
    By BuezaWebDev in forum C++ Programming
    Replies: 5
    Last Post: 04-07-2005, 10:42 PM
  5. Replies: 10
    Last Post: 01-14-2005, 01:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21