The information in this article applies to:
SUMMARYADOCtl.Exe is a sample that contains ADOControls, a class library containing controls that can be "bound" to an ActiveX Data Objects (ADO) recordset. Using these controls, a developer can create forms that can access and update ADO recordsets. MORE INFORMATIONThe following file is available for download from the Microsoft Software Library: ADOCtl.exe
Though the controls can be used with plain ADO data, the purpose of the
controls is to allow data access using Active Documents and Remote Data
Services (RDS). The following controls are included in the Adocontrols.vcx
file:
The ADO controls need either a Remote Data Service (RDS) Data Control or an
ADO Data Control for their data source. To connect a RDS Data Control to a
server, set the following properties:
To send updates to the server, call the data control's UpdateRecordset method. To cancel changes, call the data control's RefreshRecordset. This has the effect of canceling changes since the RefreshRecordset method requeries the server and refreshes the controls with data that is unchanged. The ADO Data Control works in a manner similar to the RDS Data Control. The main difference is the properties that must be set:
After setting these properties, call the data control's BindControls method
to populate the ADO controls on the form.
Once a data control is added to the form, you can now add ADO controls to the form. The following two custom properties need to be set in order to bind the control to a data control:
The Rdssimple.pjx file is a sample Active Document project that demonstrates using the ADO controls for Internet data access. To use the application, create a system data source name (DSN) on the Internet Information Server that points to a SQL Server. Set the database to the Pubs sample database. Run the Rdssimple.app file either by typing "DO rdssimple.app" in the Command window or by selecting Tools from the main menu, then clicking Run Active Document and selecting Rdssimple.app. Enter the server name and connect string in the appropriate text boxes. The server name will be in the format "http://MyServer" (without the quotes). The connect string will be in the format "dsn=MyDSN;uid=John;password=password;database=pubs" (without the quotes). For the SQL statement, enter "select * from authors", then click the Run button. If the server name, connect string and SQL statement are correct, the ADO controls will be populated with data. If no SQL Server is available, it is a trivial task to change the DataControl and DataControlField properties as needed to access a different type of data. The Adosimple.scx file is a sample form demonstrating usage of the ADODatacontrol. To use the form, enter a connection string (such as "provider = sqloledb;data source=MyServer;initial catalog=pubs;user id=John;password=password", without the quotes) and a SQL statement. Click Run and the ADO grid populates with data from the server. REFERENCES
For additional information, please see the following articles in the
Microsoft Knowledge Base:
Q182580 HOWTO: Setting Up a Quick Menu for an ActiveDoc App Q182579 HOWTO: Getting Started With Active Documents(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Mike Stewart, Microsoft Corporation. Additional query words:
Keywords : kbfile kbActiveDocs kbADO kbDatabase kbVFp600 kbGrpFox kbGrpMDAC |
Last Reviewed: November 19, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |