[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Visual C++ and Database

Posted on 2000-03-07
10
Medium Priority
?
226 Views
Last Modified: 2013-11-20
Hello Gurus,

Is it possible to access Oracle database from an application writen in Visual C++. If yes , how can I do it? I would  like to receive code semples if possible !

Thankx,

Indy
0
Comment
Question by:tybe
[X]
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
  • 2
  • 2
  • +2
10 Comments
 
LVL 1

Expert Comment

by:Deckmeister
ID: 2591146
Hi,

I know it is possible to access Oracle databases from an application written in Visual C++.

In order to do that, you have to use the Microsoft Visual Database Tools (new in VC6).

To have more infos, take a look at http://msdn.microsoft.com/library/devprods/vs6/vstudio/vdbref/dvovrnewfeatures.htm

Sorry, but I've never accessed an OracleDB from VC, so I can't help you much more.
0
 
LVL 6

Expert Comment

by:MichaelS
ID: 2591188
I think you have to use OCI (Oracle call interface). For sure only if you want to use the native drivers. The alternative way is to use ODBC, for that you can use ADO for example.
0
 
LVL 1

Expert Comment

by:Deckmeister
ID: 2591262
MichaelS>
In order to use ODBC, you have to "register" the database under the windows Control Panel.
Is it possible with Oracle DB?

Moreover, ODBC isn't the best way to access to databases, because of its limited functions.
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 32

Expert Comment

by:jhance
ID: 2591376
If you application is going to work ONLY with Oracle and you are sure you will never change to another database engine, then the OCI is the fastest and most efficient way of accessing Oracle.  THe drawback is that it works only with Oracle.

ODBC is obsolete and should not be used in new designs unless there is no support for DAO.

DAO (Data Access Objects) is the Microsoft recommended database neutral method of interfacing a Windows program (VC++, VB, whatever) to an underlying database engine.  The drawbacks are slower performance than the native interface, need for additional setup/configuration.  In return for this you get greater independence from the database itself.

There are many references available (both online and printed) in building DAO.  MFC support DAO via its CDaoDatabase class.  ODBC is support via the CDatabase class.
0
 
LVL 32

Expert Comment

by:jhance
ID: 2591385
By the way, there are a couple of DAO sample projects using CDaoDatabase in the SDK.  See the DAOTABLE and the DAOVIEW sample applications.

The Oracle SDK (comes with Oracle) has samples on their native OCI interface.
0
 
LVL 6

Expert Comment

by:MichaelS
ID: 2591434
Actually, as I know, Microsoft recomends to use ADO, not DAO.
0
 
LVL 1

Expert Comment

by:Deckmeister
ID: 2591506
You cannot use DAO because it uses the MS Jet Engine (the engine of MS Access).
And Jet isn't supported by Oracle.
0
 
LVL 5

Expert Comment

by:vachooho
ID: 2592532
Another solution
Oracle Ole Objects which are simple in use and internally use OCI calls - the fastest way to access Oracle databases

Also you can use Oracle's MFC objects
All mentioned sources come with Oracle install.

There you can find samples for OO4O and OMFC. Look in the corresponding directories.


0
 
LVL 3

Accepted Solution

by:
ghimireniraj earned 900 total points
ID: 2608098
It is absolutely possible to have a VC++ developed program to acess the Oracle datadbase?

Well How?

1)make a DSN ( data sourse name using
Oracle ODBC driver) from the control pannel.


2)then ,assuming that you have ready the tables that you want to acess in the database,


3)start the application wizard,

step1-->choose single document
step2-->database view with out file support
click the datasourse button

select your DSN (that you created)

enter username, password, service,

select your table


when the form view appears
add edit boxes and
press CTRL+double click

Map to corresponding table column fields

well the application is ready


But to write flexible applications read CDatabase and CRecordSet Classes from the MSDN and there are sample codes as well.

I can help you if you need more help.
My email address is

niraj_ghimire@hotmail.com













......














0
 
LVL 5

Expert Comment

by:vachooho
ID: 2608263
ODBC (and CDatabase and Crecordset) has very performance on Oracle databases
I found out that OCI has the best performance for quering.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

649 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