OLEDB

xiaoxiao2021-03-06  56

There are many ways to use the database, for most databases, select C this product may not be appropriate. We know that products like DBASE IV, FoxPro, Oracle and Access are completely database management. In fact, these products are very good at creating database managers, so that they are not good at doing too much work. Even if you want to perform some types of jobs with more generalized rather than more dedicated database products, it is more likely to make programming, and the RAD environment like VisualBasic and Delphi is much better than Visual C .

Are you very strange to me? Below I will talk about what I can do with Visual C when talking about this topic using the Database Management System (DBMS). Although the above other languages ​​make DBMS written by mature interfaces and high-speed search capabilities, they are as easy as children do, but they lack certain important things that Visual C can provide. You can't easily write a utility for a database using Access. As definitions of utilities, the utility should be small and have portable -Access applications is not the case. That is, the programs created using the product such as Access can be small and can be transplanted, you still have other needs: the underlying function.

Note: When writing a database utility and driver, you can select Visual C language.

Imagine, using languages ​​like Visual Basic to deal with real-time data acquisition devices. When undergoing underlying access, the protection environment of the RAD often causes programmers to do effectively. Of course, the data acquisition device has almost reluctantly on a concise connection. How do you plan to connect Visual Basic and external data sources? Data sources may not even understand Windows, DOS, or similar mature operating systems.

As long as you use it, it is easy to see Visual C is an indispensable database management tool. For large-scale applications, even if you still want to rely on the Rad language like Visual Basic, consider Visual C , which is small, which provides underlying access, and provides real-time access. In fact, you may haven't thought that the market of Visual C database applications is very potential. As people increasingly use laptops and palms in the journey, database applications on these two computers have become more common. You may be able to adapt to the Access application on your laptop today, but when you talk about hard drive size or memory demand, your older laptop may not meet the requirements. The palm of running Windows CE is definitely malfunction when running this Access application. In this new field of this database market, Visual C offers a priceless tool.

The web link talks to the use of Visual C and the database, in fact you are not alone. From the beginning, there is a database-specific newsgroup to provide help, such as Microsoft.Public.access. However, these newslets provide general information, which is not all useful to actually write applications. The newsgroups specifically for Visual C are Microsoft.Public.vc.Database and Microsoft.Public.vc.mfcdatabase. If you decide to access the database with an ODBC, you may also see the Microsoft.Public.odbc.sdk newsgroup, which is not just SDK. Programmers for the latest technologies can check the Microsoft.Public.ado newsgroup, or Microsoft.Public.OleDB (object link, and embedding database) newsgroup, the former discusss ADO, the latter discusses the basic technology of ADO. There is an ADO subgroup in Microsoft.public.ado.r, which discusses remote data access. Since all doubts are eliminated, most people's confidence will be enhanced. Here we introduce two main methods for accessing data in the C access database: ODBC (Open Database Interconnect) and ADO (ActiveX Data Object). In this chapter, these two types of access methods will be introduced, but I think you will find that the ADO method is used for new programming situations. It overcomes the many restrictions on early technology, depending on the new underline access method OLE-DB (object link, and embedded database). Behind this book we will see that the various wizards provided by ADO and Visual C will bring together database projects, how fast is there.

Note ODBC is usually used to access data in non-Microsoft databases that do not have OLE-DB characteristics; 16-bit ODBC drivers can work very slowly.

ODBC is known in the 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, you still need to use ODBC. . In most cases, this means to get the driver required from the database vendor, although Visual C does have some product drivers (if you are using some mysterious features of the Database Manager, then you need to establish It is not a very difficult thing to interface your own interface. Essentially, you always have to use ODBC to access the database created by other DBMS products other than Microsoft products, which do not have OLE-DB functionality. ODBC also requires some additional job jujubs to adjust most of the wizards in Visual C .

Advanced skill

In addition to using ADO and ODBC, you can also use early technologies like DAO (Data Access Objects), which is included in Microsoft products like Access. DAO relies on Microsoft Jet database engines that are automatically available with Microsoft Access. DAO is still the engine used by the earlier version of Visual Basic (the latest version of Visual Basic and Visual C depends on the same ADO / OLE-DB combination), so if you need to support your earlier Visual Basic application, then DAO is still a Nice choice.

Although the Microsoft file declaration can use DAO to access the database established by non-Microsoft products, but you will still find that in this case, it is much better to use ADO and ODBC. In this case, not only the compatibility problem will be less, and the speed will also increase because the interface layer passed by the data request is reduced. There is a experience to remember that DAO is designed to handle MDB files. A problem with ADO is that it does not support remote communication. This is one of the reasons why Microsoft proposes RDO (remote data object). This kind of special technology is used in the Visual Basic application, much more than the use in Visual C , so I guess, there are many people in you are using it. However, remembering RDO is still a very strong technology, this is very important. ADO does have a remote data service (RDS) feature that replaces RDO. In other words, ADO provides two functionality of DAO and RDO in a package.

-------------------------------------------------- -------------

Simply said that OLE DB is a technical standard. It is to provide a uniform data access interface. The "data" mentioned here, except for standard relationship In addition to the data in the database, there is also included mail data, text or graphics, directory services (Directory Services), and IMS and VSAM data in the host system. The nucleus of the OLE DB standard is to ask the Data Store to provide a similar access interface to make the data. (Application Program) can access various data in the same way, without considering the specific storage location, format or type of data.

-------------------------------------------------- -------------

1, ADO, ActiveX Data Objects, is Microsoft's access to the ASP's access to the COMPONENTS ADO access to the database, and the memory needs to be smaller. Let's see how to create a database connection with the ASP combined with the Connection property.

String Connect a SQL Server library

The OPEN method in the code is to open a connection, followed by a string. Driver = {SQL Server} means that the connection is a library of SQL Server. And PWD two is the username and password of the login database server, and the last option is the name of the database you want to operate.

2, Open Database Connectivity, ODBC) is a common interface for linking databases. ODBC is a database link standard leading to Microsoft, and the actual environment is also the most mature SQLServer in Microsoft's system:

Set con = Server.createObject ("AdoDb.Connection")

Con. Open "Data Source Name", "Login Name", "Password"

Access:

Set con = Server.createObject ("AdoDb.Connection")

Con.open "Data Source Name"

转载请注明原文地址:https://www.9cbs.com/read-113626.html

New Post(0)