C programming with accessing Database

This is a discussion on C programming with accessing Database within the C Programming forums, part of the General Programming Boards category; Actually I don't know whether database can be accessed by C. If you know please help me, how can I ...

  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    3

    C programming with accessing Database

    Actually I don't know whether database can be accessed by C. If you know please help me, how can I connect with MS Access or MySQL by C? How can I perform insert, update and delete command with C code? Please help me with well written source code.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by mahedee View Post
    Actually I don't know whether database can be accessed by C. If you know please help me, how can I connect with MS Access or MySQL by C? How can I perform insert, update and delete command with C code?
    Yes, many computer languages have libraries that allow SQL access to databases.

    There are actually two ways:
    1. A precompiler that supports SQL queries that are inserted directly into the source code, which translates the SQL interaction into C source and then passes it to the C compiler, e.g.
    http://infolab.stanford.edu/~ullman/...96/sy-sql.html

    2. Library that supports calls to SQL functionality, where the query is formed using standard C code, and function calls made to the library.

    ODBC may be of interest. http://en.wikipedia.org/wiki/Open_Database_Connectivity

    Please help me with well written source code.
    This is harder, as it would require us knowing what you actually want to do [and probably not even then will we actually do what you ask for, since it's most likely either school work or too complex to solve in a short time].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    43
    I prefer postgresql but have never used it in a Windows environment. They also have pretty good documentation - check out http://www.postgresql.org/docs/8.3/i...tive/ecpg.html and http://www.postgresql.org/docs/8.3/i...ive/libpq.html

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. accessing an SQL database through C++
    By abachler in forum Windows Programming
    Replies: 11
    Last Post: 11-20-2008, 11:41 PM
  2. Creating a database
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 06-10-2007, 02:09 PM
  3. accessing a database made in Access..
    By willc0de4food in forum Windows Programming
    Replies: 4
    Last Post: 10-10-2005, 08:40 PM
  4. Developing database management software
    By jdm in forum C++ Programming
    Replies: 4
    Last Post: 06-15-2004, 05:06 PM
  5. Accessing a database from a dialog.
    By Robert602 in forum Windows Programming
    Replies: 7
    Last Post: 02-03-2002, 11:29 PM

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