Recommended Posts

First of all thank you for takeing the time to look!
I have to do a large assignment on databases with C++. I''m kind of lost here, as I don''t even know how C++ handles databases.
What I need is a link or just a point in the right direction so I can start doing research myself, I''ve got Ivor Norton''s book called "Beginning C++" it''s a big red book on around 1000 pages. The cloests I could come in that is file and stream handeling - is this what I need or is there some way to work a specific database where I can create records etc.?
I''m sorry for being so vague, it''s the best I can do though... I hope there is someone out there who can give me a hint or two?
Thanks!
Yip

0

Share this post

Link to post

Share on other sites

Short answer: C++ doesn''t handle databases. Look into MySQL or something the like and download their C++ libraries for database programming. Alternately use a compiler/IDE suite that comes with database functionality (I believe Borland C++ Builder has Oracle access available).

The file streams and stuff could be what you''re looking for if you plan on making your own database format, but I highly doubt that''s what you want. It''s not only tedious and error-prone but not at all worth the effort.

Just wondering, you say this is an assignment; so it''s very likely for school (if it''s for work, Gods help you...). Have you considered asking the instructor what you''re supposed to do? Because given how vaguely you described it, what came right off the top of my head here is that this is an assignment for a class in which you attend only one in five lectures.

If that''s not the case and your prof is whacked so bad that they''re giving you assignments like this ("make a program with databases with C++") without explaining anything, then you really need to talk to them.

Otherwise, without further clarification, nobody can help you much more.

Share this post

Link to post

Share on other sites

No thank god it''s not for work, it''s for school... the problem is I''m not quite sure the "instructor" knows what he is doing

The assignment is something we have to study for ourselves, it''s "above" what we are being teached. Basically what he wanted was being able to create and delete records, fill in and change the contents of the records.

"The file streams and stuff could be what you''re looking for if you plan on making your own database format, but I highly doubt that''s what you want. It''s not only tedious and error-prone but not at all worth the effort."

I''ve got around a month and a few weeks to complete this assignment, is that too little time to be able to get a decent grasp of this? And would it have the function that I stated above?

Thanks again, I know I''m being very vague here... but you''d just have to know the "teacher" to understand why I can''t be more clear (as I don''t know anything on the subject yet myself) he said he had teached C++ before though.

Share this post

Link to post

Share on other sites

Is it REALLY that hard to make your own database format (I''m assuming that statement in quotes in the instructor''s) It doesn''t seem hard to me to create a basic database structure, and then be able to add and remove records. Maybe I''m missing something

Share this post

Link to post

Share on other sites

For one lab in my C++ class lat quarter, I had to create a music database. The data was from a plain text file, and was read in by the program and placed in memory, almost like records (database records, that is). You didn''t ahve to actually have the music files, but that was the premise for the lab - keeping track of music files. It was an interesting assignemnt, and took a fair bit of work to finish. Although I had about a month to do it.

Grant Palin

0

Share this post

Link to post

Share on other sites

Hmmm does your course happen to be 122? Taught by a grad student because if so than you and I are in the same boat , I''m having trouble reading the string in and then converting it into integers so my program can handle said integers, I''m trying to use System::IO::StreamReader, and handing that down to a System::String called RawData then I have to convert RawData to an int using RawData->ToInt32 but I need something called a IFormatProvider. Did that make any sense whatsoever if so any help converting a System::String to an int?