Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert CDatabase to CDatabase*

Status
Not open for further replies.

Huskey

Vendor
Aug 23, 2002
53
0
0
GB
Hi,

can anyone please tell me how to convert a database defined in CDatabase to a CDatabase* instead. Also, what are the differences?

Many thanks!!!!

 
That is a pointer of CDatabase.
What do you need it for?If you have to pass it as an argument to a function use '&' before your CDatabase object.
 
Dear Viorel,

Thank you for your reply. My question is actually how to pass an information of CDatabase from a CDialog class to the another class which define the database as CDatabase*.

For example, I have a CDialog class which is defined as:
CDatabase db; (defined in the header)
db.Open(NULL,false,false,"ODBC;",TRUE);
....

I have another class which needs the information from the opened database. The declaration:

Header file:

Protected:
CDatabase *database_;

Database Parameter:
CDatabase *GetDatabase() const {return database_;}

When I tried to use this GetDatabase() in my CPP file to retrieve the information, I got NULL in return. Please help if you can.

cheers,




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top