User Tools

Site Tools


ado_example_suite.htm
Navigation:  Guide to Examples >====== ADO Example Suite ====== Previous pageReturn to chapter overviewNext page

This example applications and source for all ADO based examples are located in the \(CLARION ROOT)\EXAMPLES\ADO folder.

The following example programs, each demonstrating one or more features of the new ADO template set, are listed here:

ADOExample

This example application demonstrates how to setup an ADO connection using the ADO Support global extension template. The connection part is performed with an ADOlogin procedure, which will in turn call an ADOError handler (if necessary).

This application also shows the features of the ADO Browse Box (header sort, moving/hiding columns), the BrowseQBEList control template, ADOForm, and an ADOReport.

ADONorthW and ADOData

These applications are exactly the same as ADOExample application, except that they are using an EXE/DLL deployment strategy.

Connect

This is a small hand coded program that demonstrates how to use the classes to establish a connection with the ADO database.

The source code shows the following:

·That COMIniter will init the COM object.

·The creation of a Cconnection instance. If CConnection object is created properly, the Init() method is called (which is responsible to create the real ADO connection object).

If the Init() method returns with no error, it means that the Cconnection object has a valid reference to an ADO connection interface. It will then call the Connect method (which will pass the Connect string to the ADO connection interface and wait for the result).

If Connect returns the S_OK equate value, the connection is established with the database.

ConnErr

This is a small hand coded program that shows how to handle ADO connection errors. The code has an intentional mistake in the connection string and will redirect the code to the error handler when the connect method fails to connect.

The same steps are performed as in the Connect example above, except we know that an error will occur.

The Error handler procedure demonstrates the following:

·How to extract the Errors collection from a Cconnection object by using the Errors method.

·If that Errors collection has any error item in it, the GetCount method will return the number of errors in the parameter passed by reference to that method.

If the value is non-z

ado_example_suite.htm.txt · Last modified: 2021/04/15 15:56 by 127.0.0.1