Databases are the strong, silent type. Day in and day out, they house and keep our data in check, sitting silently in the background until we query them for information. Equally strong and silent is the technology that lets scripts interact with databases: ActiveX Data Objects (ADO). Using ADO, you can interact with not only a variety of databases, including Microsoft Access, Microsoft SQL Server, and Oracle, but also other data stores such as Active Directory (AD) and Microsoft Excel. You can even use ADO to work with data in comma-separated value (CSV) text files.
Perhaps it's because ADO is the strong, silent type that not much has been written about it compared with how much coverage other technologies such as Windows Management Instrumentation (WMI) and Active Directory Service Interfaces (ADSI) have seen. If you conduct a search on the Scripting Pro VIP Web site you'll run across a lot of articles that discuss scripts in which ADO is used but few articles that explain how to use it. The most notable articles are "Rem: Obtaining Data from a SQL Server Database" by Mike Otey and "An ADSI Primer, Part 5: Using ADO to Script Fast ADSI Searches" by Alistair G. Lowe-Norris. "Rem: Obtaining Data from a SQL Server Database" discusses how to use ADO in VBScript code to access a SQL Server database, read the data from a table, and write that data to a file. "An ADSI Primer, Part 5: Using ADO to Script Fast ADSI Searches" is part of a series on ADSI, so it concentrates on how to use ADO for accessing AD. The article provides an introduction to the ADO objects, properties, and methods you use for that purpose.
To give ADO the coverage it deserves, Scripting Pro VIP will be running several articles that explain how to use it. We'll cover the basics, but if there's a specific topic you'd like covered, please let me know via email. Look for the ADO series to start in early spring 2008.
In the meantime, if you're interested in seeing ADO in action, here are some of the scripts that we've provided:
For examples of how to use ADO to work with AD data, take a look at Updateattribs.vbs in the article "Updating AD Attributes—Revisited" by Steve Seguis. This script updates attributes for AD objects, using a CSV file or an Excel spreadsheet as an input file. Chang Lu's ScriptTemplate.vbs script in "Don't Let Your AD Scripts Hang on You" also uses ADO to work with AD data. If you prefer JScript or Perl, check out Bill Stewart's LastLogon.js script in "Finding a User’s Last Logon" or Dave Roth's FindEmail.pl script in "Locating Email Accounts in AD."
As some wise person once said, nothing is ever truly free. Such is the case with VMs, which can quickly mutate from a cost-reducing Dr. Jekyll into a time-consuming, profligate nightmare that would do Mr. Hyde proud. ...
Critical Challenges of ESI & Email Retention Are you storing too much electronic information? Get expert legal advice and better understanding of what you are required to do as an IT professional.
Rev Up Your IT Know-How with Our Recharged Magazine! The improved Windows IT Pro provides trusted IT content with an enhanced new look and functionality! Get comprehensive coverage of industry topics, expert advice, and real-world solutions—PLUS access to over 10,000 articles online. Order today!
Get It All with Windows IT Pro VIP Stock your IT toolbox with every solution ever printed in Windows IT Pro and SQL Server Magazine plus bonus Web-exclusive content on hot topics. Subscribe to receive the VIP CD and a subscription to your choice of Windows IT Pro or SQL Server Magazine!
Order Your Fundamentals CD Today! Gain an introduction to Exchange, learn server security requirements, and understand how unified communications can play a role in your messaging strategies with this free Exchange CD.
rearly May 07, 2008 (Article Rating: