Differences between ADO and ODBC

Source: Internet
Author: User
Tags ole

There are many ways to use databases. For most databases, C ++ may not be suitable. We know that products such as dbase iv, Foxpro, Oracle, and access are completely database-centric. In fact, these products are so good at creating database managers that they are really not good at doing too much other work. Even if you want to use a database product that is more universal than dedicated, in order to make program design easier, rad environments like Visual Basic and Delphi are much better than visual C ++.

Are you surprised to hear from me? Next I will talk about what VISUAL C ++ can do when talking about the use of database management systems (DBMS. Although the above other languages make it as easy to write mature DBMS including user interfaces and high-speed search capabilities as children play games, they lack some important things that visual C ++ can provide. You cannot easily compile utilities for databases using access. As the definition of a utility says, the utility should be small and portable-but not the access application. That is, programs created using products such as access can be small and portable. You still have other requirements: underlying functions.

Note: When writing Database Utilities and drivers, you can select visual c ++.

Imagine using a language like Visual Basic to deal with real-time data collection devices. When accessing the underlying layer, Rad's protection environment often prevents programmers from performing effective processing. Of course, data collection devices almost do not rely on concise connections. How do you connect Visual Basic to external data sources? Data sources may not even know windows, DOS, or similar mature operating systems.

Once used properly, Visual C ++ is an indispensable database management tool. For large-scale applications, even if you still want to rely on RAD languages such as Visual Basic, consider Visual C ++, it creates a small program that provides underlying access and real-time access. In fact, you may not have imagined that the market for Visual C ++ database applications has great potential. As people are increasingly using laptops and palm computers on their journeys, database applications on these two types of computers become increasingly common. You may be able to adapt to Access applications on today's laptop, but when talking about hard disk size or memory requirements, older laptops in the company may not meet requirements. Run Windows
CE's palm computer will certainly fail when running this Access application. In this new field of the database market, Visual C ++ provides invaluable tools.

Web links talk about using Visual C ++ and databases, but you are not alone. From the very beginning, there was a dedicated database newsgroup to help with database creation techniques, such as microsoft. public. access. However, these newsgroups provide general information, which is not all that useful for writing applications. Microsoft. public. vc. database and microsoft. public. vc. mfcdatabase are newsgroups dedicated to Visual C ++. If you decide to use ODBC to access the database, you may also need to check the microsoft. public. odbc. sdk newsgroup, which is not just about sdks. Programmers interested in the latest technology can refer to the microsoft. public. ado news group or microsoft. public. oledb (Object link and Embedded Database) news group. The former discusses
The latter discusses the basic technology of ADO. There is an ado sub-group in microsoft. public. ADO. rds, which discusses remote data access.

Since all doubts are eliminated, the confidence of most people is enhanced. Next we will introduce two main methods for C ++ to access data in the database: ODBC (Open Database interconnection) and ADO (ActiveX Data Object ). In this chapter, we will introduce these two types of access methods, but I think you will find that the ADO method is used for new programming scenarios. It overcomes many limitations of early technology and relies on Microsoft's new underlying access method OLE-DB (Object Linking and Embedding databases ). Later in this book, we will see how fast it is to collect database engineering with various guides provided by ADO and Visual C ++.

Note ODBC is typically used to access data in non-Microsoft databases that do not have the OLE-DB feature; a 16-bit ODBC driver may work very slowly.

ODBC is famous for its slowest data access method, but it is a pity that when ADO or DAO does not support a Database Manager and ODBC supports this database manager, in this particular case, you still need to Use ODBC. In most cases, this means obtaining the required driver from the database vendor, although Visual C ++ does include some product drivers (if you are using some mysterious features of the Database Manager, it is not very difficult to create your own interface token ). In essence, you always need to Use ODBC to access the databases created by DBMS products other than Microsoft products that do not have OLE-DB functionality. ODBC also requires some additional work to adjust the Visual for ADO
C ++.

Advanced Skills

In addition to using ADO and ODBC, you can also use early technologies such as DAO (Data Access Object), which are included in Microsoft products such as Access. DAO depends on the Microsoft Jet Database Engine automatically obtained using Microsoft Access. DAO is also the engine used by earlier versions of Visual Basic (the latest Visual Basic and Visual C ++ depend on the same ADO/OLE-DB combination ), therefore, if you need to support earlier Visual Basic applications, DAO is still a good choice.

Despite the Microsoft File declaration, you can use DAO to access databases created by non-Microsoft products, but you still find that using ADO and ODBC is much better in this case. In this way, not only will there be fewer compatibility issues, but the speed will also be improved, because the interface layer for data requests is reduced. Remember that DAO is designed to process MDB files.

One problem with ADO is that it does not support remote communication. This is one of the reasons why Microsoft proposed RDO (Remote Data Object. This special technology is used much more in Visual Basic applications than in Visual C ++, so I guess many of you are using it. However, it is important to remember that RDO is still a technology with strong vitality. ADO does have the feature of replacing RDO Remote Data Service (RDS. In other words, ADO provides DAO and RDO functions in a software package.

Source: http://www.yesky.com/415/1839915.shtml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.