Thread: Use MS Access in C

  1. #1
    Registered User laughing_man's Avatar
    Join Date
    Jun 2009
    Location
    Bombay, India
    Posts
    26

    Use MS Access in C

    Just exploring! Can someone PLEASE help me with a tutorial or something on how to use MS Access in C(Windows API)? Do not tell me to use C++. And yes, I have checked Google and am unsuccessful at finding a beginner one. Also, could you not point to any MS website, because for some reason my PC is not loading its website for quite some time now.

  2. #2
    Registered User
    Join Date
    Nov 2012
    Posts
    1,393
    I would start with this one (it shows how to access your MS access database via ODBC). It uses MFC which is C++, but you should be able to get the basic idea

    How To Export and Import Access Tables Using DAO or ODBC

    For doing the above using C api take a look maybe at this tutorial

    ODBC from C Tutorial Part 1

  3. #3
    Registered User laughing_man's Avatar
    Join Date
    Jun 2009
    Location
    Bombay, India
    Posts
    26
    Hi c99tutorial! Well, I had checked both your links in the past and it was not helpful to me at all. I am just looking for a simple solution. I am looking for some plain win32 api stuff. I recently found out about this DDE stuff but find it difficult to understand, altough it seems to have been there in VB3 too. Do you happen to know any links to simple examples of it.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Do you really need to access Access, or would another relational database system work for you?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User laughing_man's Avatar
    Join Date
    Jun 2009
    Location
    Bombay, India
    Posts
    26
    Actually I don't need... But I am attached to MS Access' usability. So I want to know if there is a simple way in which I could write small C win32 GUI apps which could connect to my MS Access databases. I know there are other options like raw flat files(too much management, too much time to create) and SQLite but I am looking one for Access. I used to using Access via some other languages.
    Last edited by laughing_man; 09-03-2014 at 02:00 AM. Reason: missed a word

  6. #6
    Registered User
    Join Date
    Nov 2012
    Posts
    1,393
    A Web search turned the following up for me. It is a library for accessing MS Access files using a Java interface. They might be using a C library in the backend that you could make use of if you want to use it in your application (does not seem to require ODBC) ; check the references on that page for more information.

    Java Library for MS Access

  7. #7
    Registered User laughing_man's Avatar
    Join Date
    Jun 2009
    Location
    Bombay, India
    Posts
    26
    c99Tutorial - what you tell me to do is overwhelming and a over the head bouncer as I find it difficult reading other people's huge projects. But I will try... See you guys next year after I finish trying to read the code
    Last edited by laughing_man; 09-04-2014 at 10:13 AM.

  8. #8
    Registered User
    Join Date
    Nov 2012
    Posts
    1,393
    If your goal is easy database solution is there a reason you're not using a language that has this built in already? Many dynamic languages have out-of-the-box database support. On the other hand if your goal is to learn C then maybe looking at ODBC connections and 3rd party libraries is not the easiest approach??

  9. #9
    Registered User laughing_man's Avatar
    Join Date
    Jun 2009
    Location
    Bombay, India
    Posts
    26
    I understand you. I was just exploring my options..I mean I wanted to know what "I" was comfortable doing in C. To all the replies - THANK YOU!

  10. #10
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273
    Ah, cold sweat time. Haven't been moist for a while...

    To access an Access database (.mdb), the most common interface for C/C++ was ActiveX Data Objects (ADO).
    This exposed a load of COM objects that you could use to connect, run queries, retrieve rows and such.

    It might be worthwhile using that in C++, but not C.
    I actually wrote the equivalent C code during my "C IS TEH ONE TREU LANGUAGE!!111!!1!" phase, was something like eight times as long, painful to maintain and provided no discernable performance improvement.

    Chalk that one down to life experience.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. dll access help
    By maverick.guru in forum C++ Programming
    Replies: 3
    Last Post: 05-31-2004, 12:36 PM
  2. Can't access the FAQ
    By mlsbbe in forum C Programming
    Replies: 0
    Last Post: 04-04-2003, 07:37 AM
  3. Access VB DLL from C++ ?
    By torbjoen in forum Windows Programming
    Replies: 3
    Last Post: 12-05-2002, 07:14 AM
  4. IP access and DNS access to Cprog.com
    By mithrandir in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 08-31-2002, 07:22 PM
  5. Access .....
    By GodLike in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 06-20-2002, 09:58 AM