CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 1999
    Posts
    89

    Creating databas via MFC

    I am VERY new to database programming, i.e. just started to read about database programming using C++.

    I want to create database via my MFC/C++ application. I want to avoid using another third party application like ACCESS to manually create database files. That means when my application runs, and it could not find for example a mydatabase.mdb (mdb is a Jet Engine database ) file, then it would proceed to
    created a default database file.

    All the stuff I read so far assume you have a database somewhere already. Surely there is a way to do this.

    Also, it there a control component that lets user create database?

    Anyone knows of a great C++/database forum/site?
    Thank you.

    Kind regards,
    H.P. Ng



  2. #2
    Join Date
    May 1999
    Location
    Seattle, WA USA
    Posts
    423

    Re: Creating databas via MFC

    I do not understand what you mean by "Create a Database". You could just output all the data you need to a text file, and that would be a database. Encrypt the data and add some indexing & speedy access functions, and you can sell it. There is really not much to a database, it is a really simple idea--the hard part is just making it fast to access & reliable.

    Anyway, maybe if you could explain your requirements a little more & what you need your database to be able to do, someone can be more helpful.

    HTH
    --michael


  3. #3
    Join Date
    Apr 1999
    Location
    Alabama, USA
    Posts
    261

    Re: Creating databas via MFC

    Here is a trick I used long ago in VB, but it should work in VC++ as well. Use access to create an empty .mdb file named default.mdb for example. Then when your application notices that there is no database, you simply copy and rename the empty database.

    Of course it is easier to just call the CDaoDatabase::Create() function... :-)





  4. #4
    Join Date
    May 1999
    Location
    Republic of Korea
    Posts
    100

    Re: Creating databas via MFC

    There is a sample in Visual C++ help contents.
    So search for "DAOTABLE sample". It shows U a way
    to create database, tables, and index thru
    CDaoDatabase class.

    Hope for help.

    Walter


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

Featured