[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


need help urgently

Posted on 1998-09-10
Medium Priority
Last Modified: 2013-11-20
My project is going to due soon....about a week or two from now..and this is what happened...after I got extension from the due date.
I have done my projects but unfortunately, I saved them in 2 files.
One is my project for image processing where I need to extract some
features out. And I have done that part. I am able to show the values out
in a messagebox.
Also, I did another project, for my database where I am suppose
to store those values I extracted out. Currently, in my database, I got
those values from access only.
How should I interact both of them together? Meaning I want to calculate the values
using the first file and store them automatically in the second file(database)
when I, let say click a menu item called STORE?
Question by:kean082198
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3

Expert Comment

ID: 1322048
Is this for a school assignment?   assuming it's not,
simply have to:

1) open your file,
2) extract the data
3) Open a connection to your db (perhaps odbc)
4) Open the table
5) Add a record
6) close the table
7) close the connection to the db


Expert Comment

ID: 1322049
8) close your input data file

Author Comment

ID: 1322050
Dear Duneram,
No it is not my assignment, it is my project. So basically these are the steps I need to do:
1. Open the file - the file where I calculate the 4 values, let say a, b, c, d. OK that is simple.
2. Extract the data - yup, the 4 values are extracted…got them as a, b, c, d and is able to display those values out when I click display on the menu bar.
3. Open a connection to the db - I don't know how to do this part. What commands should I write and where should I do it. Which part of the function
4. Open the table - I don't understand
5. Add a record - yup, I understand this, but how?
6. Close the table - what is the command
7. Close the connection to the db - no idea how?
8. Close your input data file - please help…

Please, sir I really need help here. Please show me the step by step source codes to achieve this thing. Desperately need help. Thank you.


Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 1322051
Dear experts,
Please help...

Expert Comment

ID: 1322052
Hi Kean,
You can derive a class from CRecordset, let's call it CMySet. While doing this, you can point (in the wizard) to a table or a sql-query and classmembers are automatically created for you (for example m_ID, m_Name, etc).
In your app, you create a database connection with CDatabase.

CDatabase mydb;

Then you can use CMySet.Open to open the table you need. After that you can say:

You can close the dataconnection and the recordset with their Close()-methods.


Expert Comment

ID: 1322053
Sounds like the answer to me...

Accepted Solution

MelissaC earned 140 total points
ID: 1322054
See text above??

Author Comment

ID: 1322055
Dear Melissa,
I still don't understand what you wrote there. I am a very weak Visual C++ programmer and I need your help to tell me the step by step to do the project. What you have written are still very vague to me.
Please help.

Expert Comment

ID: 1322056
1. Deriving a class from CRecordset:
In Classwizard, click on "Add Class". You can choose between making a new class or creating a class that is a child of another (already existing) class (= a derivation class). Choose to make a class of an existing class, class CRecordset. Call it MyRecordset.
The classwizard lets you point to a table or a sql query in a database. In fact, it lets you point to a DSN (Data Source Name, you can make a DSN, which is in fact a pointer to a database, by clicking Start-Settings-Control Pannel-32bitODBC in windows).

The new class that you created with the classwizard will contain member variables, and the function DoFieldExchange. Whenever you open the recordset with the function MySet.Open(), the data from the table will be read into those member variables. You can scroll through the table by using functions like:
MySet.MoveFirst(), MySet.MoveLast(), MySet.MoveNext, etc.

2. Adding new records

CMySet.AddNew();        //create space to insert new record
     CMySet.m_ID=11;    //store value 11 in member variable m_ID of                         //MySet
                        //Store value "MelissaC" in member var.
CMySet.Update();        //Store the new values in the database
                //(in fact, the function DoFieldExchange is called)

You can close the dataconnection and the recordset with their Close()-methods.
Hope this explanation will get you on the right track!
Good Luck!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question