[Delphi] ODBC and ADO in Delphi

Source: Internet
Author: User

Delphi In ODBC And ADOBoth ADO and ODBC are used to access the database. They are encapsulation of the underlying data driver and can be used to access the database during programming. In Delphi, BDE and ADO components are also provided. In the early stage of the project, the database used access and sqlserver, and ADO was used without consideration. MySQL was used in later projects, without the ADO driver for direct access to MySQL, I think ODBC is the best, because all databases provide ODBC drivers. Later I found that ADO can also directly use the ODBC driver, which is too faint. It is understood that the speed and support of ADO is better than that of ODBC. It seems that all database access in the future can be bold and assured to use ADO, and the connection string can be changed to support ODBC. But there are still many differences between the BDE and ADO controls in Delphi. What impressed me most is the query update operation in the two controls. In most cases, bed tquery can only return read-only records but cannot be modified, unless you set the requestlive attribute of tquery and only contain one table in the result data set, note that it cannot be a query of multiple tables. Tadoquery does not have this restriction. You can simply write an SQL statement and directly update the field value, and then post the statement. Of course, a method can be used to compensate records that cannot be modified returned by tquery. That is, the updateobject attribute of tquery can be set to a tupdatesql with tupdatesql, set the update Statement of tupdatesql.

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.