Click to See Complete Forum and Search --> : Creating databas via MFC


H.P. Ng
July 7th, 1999, 11:37 AM
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

chiuyan
July 7th, 1999, 11:46 AM
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

John Holifield
July 7th, 1999, 03:16 PM
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... :-)

Walter I An
July 7th, 1999, 10:14 PM
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