Results 1 to 9 of 9

Thread: Urgent!!! Database Access in C++

  1. #1
    needaname16
    Guest

    Talking Urgent!!! Database Access in C++

    Hi Everyone,

    I am trying to write a service in an ATL object project where I need to access an access database via the code. I know that the normal method is to start with the DAO class CDaoDatabase.

    I tried:

    CDaoDatabase* MyDB;

    But C++ always returns the error "Expected ';' after CDaoDatabase" when I try to build it, I have no idea of where to go next. Please Help!?!

    Thanks a mil in anticipation.

    Needaname16.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    CDaoDatabase is an MFC class and can't intrinisically be used in ATL (which defies the principle of using ATL if you're just going to use MFC anyway ).

    You can use #import to do this, but I don't have any more info other than the name (never used it, didn't need to since I don't use COM through C++).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    needaname16
    Guest

    I'm Lost

    I looked up the import in the help and I understand what parksie means, however like him I have never tried this before and I wouldn't have a clue as to what file I need to import to get access to Access Databases. PLEASE!!!!!!! has anyone got any advice as to how I could achieve this.

    Or does anyone have any idea of how to convert a normal MFC app in C++ to a service for WinNT.

    (Surely someone has done something similar in the past)

    PLEASE!!!!

    Thanks
    Needaname16

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    There are also ADO, OLE and ODBC database access methods...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    Post How?

    Could any of you please tell me how to use and initialize the MS Access Engine? I would like to use it to store a bit of information like:

    My Name
    My Age
    My Gender

    and available for many entries.

    Thanks a lot

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  6. #6
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    engine???

  7. #7
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    YOu know

    You know just how to use MS Access to input info and then output it.

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  8. #8
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    I only dabbled in databases with vb but you have to create one first with all the places for data....I don't think you create the actual file in code though....

  9. #9
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    Post HOW?

    Can you tell me how do you input and output in ASP Code?(MS Access)

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width