Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create an ADO object

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge of "how to create ADO objects". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

If your database with ADO objects is located in the web directory of "c:/webdata/", you can use the following ASP code to connect to the database, which will not work. You are locked out of IDE, so you can only write code line by line, right?

The Errors collection of Connection objects can be emptied and preset only when the provider generates a new error or calls the Clear method. Any operation involving an ADO object can result in one or more provider errors. When each error occurs, one or more Error objects are placed in the Errors collection of the Connection object. When another ADO operation generates an error, the Errors collection is emptied and the new collection of Error objects is placed in the Errors collection.

Each Error object represents a specific provider error, not an ADO error. ADO errors are logged to the runtime exception handling mechanism. For example, in Microsoft Visual Basic, an ADO-specific error triggers the onError event and occurs in the Err object. The ADO operation that the ADO object does not produce errors has no effect on the Errors collection. Use the Clear method to manually clear the Errors collection.

The collection of Error objects in the Errors collection describes all errors that occur in response to a single statement. Enumerating specific errors in the Errors collection enables the error handling routine to more accurately determine the cause and source of the error and take appropriate steps to recover.

Some properties and methods return warnings that appear as Error objects in the Errors collection, but do not terminate the execution of the program. First call the Clear method of the Errors collection, and then call the Resync, UpdateBatch, or CancelBatch method of the Recordset object, the Open method of the Connection object of the ADO object, or set the Filter property of the Recordset object. This allows you to read the Count property of the Errors collection to test the warnings returned.

Specifies the type of ADO runtime error. Three forms of error numbering are listed below: the two low-order bytes of the full number in positive decimal-decimal format. This number is displayed in the default Visual Basic error message dialog box. For example, run-time error "3707".

Negative decimal-decimal conversion of the full error number. Hexadecimal-hexadecimal representation of the full error number. The Windows function code is located in the fourth digit. The function code of the ADO object number is A. For example: 0x800A0E7B.

Note that the OLE DB error may be passed to the user's ADO object. Typically, these errors are identified by Windows function code 4. For example, 0x8004... More information about these numbers.

This is the end of "how to create ADO objects". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report