August 31st, 2003, 03:59 PM
C++... database connectivity
i want to do some project work in turbo C++.... n just want to know how to connect to the backend database? like SQL Server or Ms Access...
is there any way, i can do the same?
thanks in advance.
September 2nd, 2003, 08:28 AM
You forgot to mention your working environment. I guess its Turbo C++ 3.0 . If it is then it dows not provide any database connectivity. If your are using VC++ consult MSDN.
September 2nd, 2003, 10:09 AM
Use VC++ and consult MSDN
guru@linux:~> who I grep -i blonde I talk; cd ~; wine; talk; touch; unzip; touch; strip; gasp; finger; mount; fsck; more; yes; gasp; umount; make clean; sleep;
September 2nd, 2003, 12:35 PM
You should be able to use ODBC. This is not dependent on what compiler you are using.
ADO may also be usable. You will of course need to be competent in COM programming and know how to use the COM library provided by your compiler (or generate stubs or something depending on the environment, I'm not really sure)
You can also use an API for a specific database. SQL server and access both provide these AFAIK, however that would not be useful if you ever wanted to change DB.
Personally, I would think ODBC to be a good approach.
IT IS NOT NECESSARY to use MSVC for any C++ database API
September 2nd, 2003, 06:09 PM
I agree with Slarty, ODBC is the way to go. Almost every modern language I know of has support for ODBC connectivity and Borland is no exception, here is a snippet from Borland's site:
Database connectivity and utilities
C++Builder and the VCL offer a variety of connectivity tools to simplify the development of database applications. The Borland Database Engine (BDE) is a collection of drivers that support many popular database formats, including dBASE, Paradox, FoxPro, Access, and any ODBC data source. SQL Links drivers, available with some versions of C++Builder, support servers such as Oracle, Sybase, Informix, DB2, SQL Server, and InterBase.
C++Builder includes components that you can use to access data through InterBase Express (IBX). IBX applications provide access to advanced InterBase features and offer the highest performance component interface for InterBase 5.5 and later.
IBX is based on the custom data access C++Builder component architecture, and is integrated with the Data Module Designer. IBX is compatible with C++Builder's library of data-aware components, and does not require the BDE.
You can create database tables at design time in the Form Designer. First, create field definitions using the Object Inspector, then right-click on the table component and choose Create Table.
Some versions of C++Builder include components to connect to databases using ActiveX Data Objects (ADO). ADO is Microsoft's high-level interface to any data source, including relational and non-relational databases, email and file systems, text and graphics, and custom business objects.
For more information...
See "Developing Database Applications" in the Developer's Guide or online Help.
\"If computers are to become smart enough to design their own successors, initiating a process that will lead to God-like omniscience after a number of ever swifter passages from one generation of computers to the next, someone is going to have to write the software that gets the process going, and humans have given absolutely no evidence of being able to write such software.\" -Jaron Lanier
September 18th, 2003, 01:43 AM
I would consider using MySQL.
There is a very nice api and documentation at mysql.com.
I used it with VC++ and it worked seemleasly.
That which does not kill me makes me stronger -- Friedrich Nietzche
September 18th, 2003, 04:55 AM
thanks a lot to you all...
yes i was using turbo c++...
ok i will try VC++ for the same purpose...
Now is the moment, or NEVER!!!