Console base timecard system

This is a discussion on Console base timecard system within the C Programming forums, part of the General Programming Boards category; Respected Sir, I try to write a small C program to simulate a TimeCard System running on DOS console, and ...

  1. #1
    C-Dumbie
    Guest

    Console base timecard system

    Respected Sir,

    I try to write a small C program to simulate a TimeCard System
    running on DOS console, and the idea of the program is basically that an employee enter his/her working time and when finish input his or her time card, they could hit F2 for submit their time which will be sent to a Database where store employment time card information thru network.
    I really could not figure out to find a way to let my DOS base program to communicate to a Database via network or internet.
    Does anyone could donate an idea that what I should do and
    how to implement it. I guess I should need using WIN32 socket and somekind of DOS API, Right?
    Thanx alot for your help and expertise.

    C-Dumbie

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826

    Re: Console base timecard system

    Originally posted by C-Dumbie

    Does anyone could donate an idea that what I should do and
    how to implement it. I guess I should need using WIN32 socket and somekind of DOS API, Right?
    Thanx alot for your help and expertise.

    C-Dumbie
    1) Pick a database.
    2) Read on it's API.

    Quzah
    Hope is the first step on the road to disappointment.

  3. #3
    C-Dumbie
    Guest
    More specific advices please!
    I think my DOS base C program is kinda similar to FTP command
    line program which connect to some server or data base.

    1) I think about database is ORACLE or MySQL or some SQL
    2) No idea about API which provide communication for DOS
    program to send data to remote Data base.
    Here is my program idea:

    C:\>timecard.exe
    C:\>Enter your employee id: 2302
    C:\>Enter number of work hours: 40
    C:\>Are you really to submit? Y
    C:\> Waiting...for your input data send to Database.
    C:\> Your submit sucessfull. Have a nice day!
    C:\>_

    Is there a way to make C DOS based program to communicate
    thru internet or network with a remote database???
    Your useful advices are deeply appreciated/
    C-Dumbie

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    First write the program without networking. Just use a dummy function as a 'stub':

    int DatabaseRecieved(char *my_query){
    return 1;
    }

    After all is well there, you need to find out what database you are communicating with. Databases usually use ASCII strings for the actual information processing such as:

    char query[] = "<update><employee><id = 123><timeworked=8.25><return=status>";

    if(!DatabaseRecieved(query))
    //..alert user, etc...

    This is, of course, not a real query, but you get the idea.

    Every database is different. Just read a book on the database you will be working with and you will learn the connection protocol, query format, and other important matters.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  5. #5
    C-Dumbie
    Guest
    Originally posted by Salem
    > DOS console
    Well first you need to decide whether this is DOS or WIN32 console
    Any advantage if I use WIN32 console? What difference between
    DOS console and WIN32 console. My PC is running Win2000 so
    I think my C program will run on MS-DOS.

    I guess my program will somekind relate with client/database server method.
    I plan to write a small C program running on MS-DOS as client
    to get employee's inputs and another C server program running on MS-DOS(remote PC) to handle client's input and store data to a text FILE.
    But I still struggling to find a way for my Dos programs to communicate each other across the network.
    Do you guys know any C library provide communication interface.

    Blow is my project plan:
    1) Resources: PC1 and PC2 both running Win2000
    2)Compiler: MS-Visual C++
    3)Programs: C Client program and C Server program
    4)Communication between 2 programs: still wandernes and ?????
    5)Still wonder that challenge myself with this project is kinda stupid idea???because we already have Unix base Interprocess
    Communication. How about DOS based???

    Hope you guys give some precious opions, suggestions or
    ideas on this project. Otherwise I probally give up!

    C-Dumbie.
    ____________________________________________
    Keep spinning the world with your talents.

  6. #6
    Registered User
    Join Date
    Oct 2002
    Posts
    385
    Originally posted by C-Dumbie
    Any advantage if I use WIN32 console? What difference between
    DOS console and WIN32 console. My PC is running Win2000 so
    I think my C program will run on MS-DOS.
    Windows 2000 isn't built on MS-DOS like Win 9x so you need to stick with Win32.
    Wandering aimlessly through C.....

    http://dbrink.phpwebhosting.com

  7. #7
    Registered User Azuth's Avatar
    Join Date
    Feb 2002
    Posts
    236
    Just an idea here, but why not just write your program to update a file (forget about your whole communications issue for a moment). Once you have that working, use Windows networking to map a drive from one PC to the other, store the file on one PC, enter the information on the other. That way it's protocol independent too.

    BTW: It really sounds as if you're not sure what you want to do, people will offer specific help if you offer a specific problem.

  8. #8
    C-Dumbie
    Guest
    Originally posted by Azuth
    Just an idea here, but why not just write your program to update a file (forget about your whole communications issue for a moment). Once you have that working, use Windows networking to map a drive from one PC to the other, store the file on one PC, enter the information on the other. That way it's protocol independent too.

    BTW: It really sounds as if you're not sure what you want to do, people will offer specific help if you offer a specific problem.
    Thanks for your suggestion. And I am not not quite clear what
    did you try to refer Window Networking. Is that you mean WIN
    socket programming?
    Writing a small program for TimeCard system running on stand
    alone PC is not really a big issue for me.
    My SPECIFIC problem for the project is trying to find a DOS base API to allow 2 seperate C programs install on different PC to communicate each other thru network or internet. I have a hard
    time to figure out how. A classmate of mine suggest me using
    WIN32 console associate win Win Socket programming.
    His idea make sense! But I still need some ideas from some
    experienced experts like you guys.
    Again, thanx

    C-Dumbie
    +++++++++++++++++++++++
    + Think globally, Act locally. +
    +++++++++++++++++++++++

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 10:13 AM
  2. Replies: 2
    Last Post: 03-05-2009, 10:25 AM
  3. Virtual base class
    By George2 in forum C++ Programming
    Replies: 7
    Last Post: 03-14-2008, 08:45 AM
  4. Number system base M, print numbers N digits wide...
    By biterman in forum C Programming
    Replies: 12
    Last Post: 11-19-2001, 04:31 AM
  5. converting numbers from one base to another
    By partnole in forum C++ Programming
    Replies: 4
    Last Post: 10-04-2001, 01:29 PM

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