How to use c++ to connect sql?

I'm using dev c++ and ms sql 2005 express.
Thank you for your help.
Google: C++ ODBC
:)
Do i must defind the database in ODBC yet?
ODBC is obsolete.
Use ADO
closed account (z05DSL3A)
ODBC is not obsolete!!!! See: Data Access Technologies Road Map @ http://msdn.microsoft.com/en-us/library/ms810810.aspx


samnet,
start at MSDN: Windows Data Access Components SDK @
http://msdn.microsoft.com/en-us/library/aa968814(VS.85).aspx
Last edited on
@george135: I don't know where you learn to code. But it's obviously VERY Microsoft bias. Remember this, it's not "Microsoft C++". It's C++.

@Grey Wolf: I've already tried to tell him =\

@Samnet: http://www.ddj.com/architect/184416383
DDJ has alot of useful C++ articles, tutorials and bits of source code. That should be a good start.

http://www.m2osw.com/en/odbcpp.html -> ODBC Class/Wrapper
Of course ODBC is obsolete ! Everyone knows that for ages.
I used it in 90's and it was already very slow, because of data source interface drivers !
ADO or OLE DB are a lot faster and the way to go, obviously.
Last edited on
closed account (z05DSL3A)
Of course ODBC is obsolete ! Everyone knows that for ages.

State you source!
It sounds like we have a difference in terminoligy here.

ODBC can be regarded as 'obsolete' in that there are newer solutions to the problem if DB connectivity such as ADO and OLE DB.

ODBC is not, however, 'depreciated' and is still supported and available to use.

Note: I'm not saying ODBC is obsolete BTW, just that it can be regarded as so from a certain perspective.
I'm also ignoring the discussion on relative merits of ADO, ODBC, OLE DB, etc at this point:-)
Last edited on
closed account (z05DSL3A)
It sounds like we have a difference in terminoligy here.


Ok, Here is where I'm coming from:

Obsolete Data Access Technologies
Obsolete technologies are technologies that have not been enhanced or updated in several product releases and that will be excluded from future product releases. Do not use these technologies when you write new applications. When you modify existing applications that are written by using these technologies, consider migrating those applications to ADO.NET.

The following components are considered obsolete:

DB-Library: This is a SQL Server–specific programming model that includes C APIs. There have been no feature enhancements to the DB-Library since SQL Server 6.5. Its final release was with SQL Server 2000, and it will not be ported to the 64-bit Windows operating system.

Embedded SQL (E-SQL): This is a SQL Server–specific programming model that enables Transact-SQL statements to be embedded in Visual C code. No feature enhancements have been made to the E-SQL since SQL Server 6.5. Its final release was with SQL Server 2000, and it will not be ported to the 64-bit Windows operating system.

Data Access Objects (DAO): DAO provides access to JET (Access) databases. This API can be used from Microsoft Visual Basic, Microsoft Visual C++, and scripting languages. It was included with Microsoft Office 2000 and Office XP. DAO 3.6 is the final version of this technology. It will not be available on the 64-bit Windows operating system.

Remote Data Objects (RDO): RDO was designed specifically to access remote ODBC relational data sources, and made it easier to use ODBC without complex application code. It was included with Microsoft Visual Basic versions 4, 5, and 6. RDO version 2.0 was the final version of this technology.
From MSDN: [ http://msdn.microsoft.com/en-us/library/ms810810.aspx ]

And from the same page:

Current MDAC Components
These components are supported in the current release. Use these components when you develop new applications or upgrade existing applications.

ADO: ActiveX Data Objects (ADO) provides a high-level programming model that will continue to be enhanced. Although a little less performance than coding to OLE DB or ODBC directly, ADO is straightforward to learn and use, and it can be used from script languages, such as Microsoft Visual Basic Scripting Edition (VBScript) or Microsoft JScript.

ADOMD: ADO Multi-Dimensional (ADOMD) is to be used with multidimensional data providers such as Microsoft OLAP Provider, also known as Microsoft Analysis Services Provider. No major feature enhancements have been made to it since MDAC 2.0.

ADOX: ADO Extensions for DDL and Security (ADOX) enable the creation and modification of definitions of a database, table, index, or stored procedure. You can use ADOX with any provider. The Microsoft Jet OLE DB Provider provides full support for ADOX, while the Microsoft SQL OLE DB Provider provides limited support. No major enhancements are planned for ADOX in future MDAC releases; however, it is available on the 64-bit Windows operating system.

OLE DB: OLE DB is a comprehensive set of COM interfaces for accessing a diverse range of data in a variety of data stores. OLE DB providers exist for accessing data in databases, file systems, message stores, directory services, workflow, and document stores. OLE DB core services (although not every OLE DB provider) is available on the 64-bit Windows operating system.

SQLOLEDB: Microsoft OLE DB Provider for SQL Server (SQLOLEDB) supports access to Microsoft SQL Server. However, SQL Native Client is recommended for creating new applications or enhancing existing applications that must take advantage of new SQL Server features in Microsoft SQL Server 2005. SQLOLEDB will continue to be supported and is available on the 64-bit Windows operating system.

Microsoft SQL Server Network Libraries: The SQL Server Network Libraries allow SQLOLEDB and SQLODBC to communicate with the SQL Server database. The following SQL Server Network Libraries have been deprecated in MDAC releases: Banyan Vines, AppleTalk, Servernet, IPX/SPX, Giganet, and RPC. TCP/IP and Named Pipes will continue to be supported and are available on the 64-bit Windows operating system.

ODBC: The Microsoft Open Database Connectivity (ODBC) interface is a C programming-language interface that allows applications to access data from a variety of Database Management Systems (DBMS). Applications that use this API are limited to accessing relational data sources only. ODBC is available on the 64-bit Windows operating system.

SQLODBC: Microsoft SQL Server ODBC Driver (SQLODBC) enables access to Microsoft SQL Server. However, SQL Native Client is recommended for creating new applications or enhancing existing applications that must take advantage of new SQL Server features in SQL Server 2005. SQLODBC will continue to be supported and is available on the 64-bit Windows operating system.

MSDASQL: The Microsoft OLE DB Provider for ODBC (MSDASQL) is a technology that allows applications that are built on OLEDB and ADO (which uses OLEDB internally) to access data sources through an ODBC driver. MSDASQL is an OLEDB provider that connects to ODBC, instead of a database. MSDASQL ships with the Windows operating system, and Windows Server 2008 is the first Windows release to include a 64-bit version of the technology.


=====================

george135 wrote:
ADO or OLE DB are a lot faster and the way to go, obviously.

again from the MSDN article
ADO: ActiveX Data Objects (ADO) provides a high-level programming model that will continue to be enhanced. Although a little less performance than coding to OLE DB or ODBC directly...
Last edited on
i want to know how the pointer works?
please give detailed explanation
@Grey Wolf: Thanks, I was going to dig up the same page :)

Of course ODBC is obsolete ! Everyone knows that for ages.
I used it in 90's and it was already very slow, because of data source interface drivers !
ADO or OLE DB are a lot faster and the way to go, obviously.


Everyone being just yourself? Please make sure the information you post is factual, and not just crap your making up. Especially when you proclaim a wrapper is faster than the original, and making the original "obsolete".

And note: ODBC is VERY widely used on *nix development or multi-platform development.
Good Job Grey Wolf and Zaita! ODBC is indeed alive and well. I prefer it to anything else. REAL MEN USE ODBC!
I typically use an ODBC wrapper supplied by wxWidgets. But it's still ODBC, and it's multi-platform :)
Topic archived. No new replies allowed.