Q&A

Q1:How do I decide when to control transactions using ADO, as opposed to using Transact-SQL?
A1: Depending upon the situation, both are good choices. Much of your decision to use ADO or Transact-SQL depends upon the type of transaction being performed. If you are performing a distributed transaction over many data sources, such as a SQL Server and an Excel spreadsheet, or want to include Visual Basic code within a transaction, it is probably best to use ADO. Your SQL Server may not know the location and how to control the Excel spreadsheet, and definitely cannot produce Visual Basic code. On the other hand, if you are controlling only database transactions and would like the transaction code to be available to other applications (even those ...

Get Sams Teach Yourself Microsoft® Windows® DNA Programming in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.