SDAC behaviour resembles the one of ADO as much as possible, so migration from ADO to SDAC shoulв not cause much difficulties. As far as possible, SDAC behaviour approaches to the behaviour of ADO, so this migration should not cause any serious difficulties.
It is necessary to note that ADO provides universal data access and, as many universal tools do, does not specialize on any. loses any specialized one. First of all, it affects performance. You can see Performance project from SDAC\Demos\Performance to find out yourself - ADO loses SDAC at different tests from 1.5 to 20 times. Besides, SDAC interface (run-time and design-time) is focused on working with specific features of SQL Server.
SDAC offers special Wizard to simplify the conversion of already existing projects. This Wizard replaces ADO-components in the specified project (dfm- and pas-files) to SDAC. ADO-components that will be replaced:
- TADOConnection -> TMSConnection
- TADOCommand -> TMSSQL
- TADOTable -> TMSTable
- TADOQuery -> TMSQuery
- TADOStoredProc -> TMSStoredProc
To run the Wizard select BDE/ADO Migration Wizard item in SDAC menu and follow the instructions. This Wizard is available only for Delphi IDE.
Note: Wizard serves only to simplify routine operations and after the conversion project might be uncompiled.
Below is a list of properties and methods which cannot be converted automatically. Here you can find hints for users to simplify manual replacement.
TADOConnection
- Attributes - not supported by SDAC. After execution TCustomDAConnection.Commit or TCustomDAConnection.Rollback, Connection is valid.
- CommandCount, Commands - not supported by SDAC.
- CommandTimeout - must be set separately for each TMSSQL and TCustomMSDataSet. See TMSSQL.CommandTimeout and TCustomMSDataSet.CommandTimeout.
- ConnectionObject - not supported by SDAC.
- ConnectionString - SDAC has similar P:Devart.Sdac.TCustomMSConnection.ConnectString property.
- ConnectOptions - not supported by SQL OLE DB provider. Connection is always settled synchronously.
- CursorLocation - must be set separately for each TCustomMSDataSet. See CursorType.
- DefaultDatabase - SDAC has similar Database property. The value of Database is always the same as ConnectString.
- Errors not supported by SDAC. Use TMSConnection.OnInfoMessage and EOLEDBError handling to obtain the requested information.
- KeepConnection - not supported by SDAC. Behaviour is similar to TADOConnection.KeepConnection = True.
- Mode not supported by SDAC.
- Properties not supported by SDAC.
- Provider has no meaning for SDAC, as only SQL Server is supported.
- State not supported by SDAC.
- Version to determine SDAC version use global variable SDACVersion. To get version of the server and client use TCustomMSConnection.ServerVersion and TCustomMSConnection.ClientVersion.
- BeginTrans use TCustomDAConnection.StartTransaction instead.
- Cancel not supported by SDAC, as SQL OLE DB provider does not support asynchronous setting of connections.
- CommitTrans - use TCustomDAConnection.Commit instead.
- Execute use TCustomDAConnection.ExecSQL instead.
- GetProcedureNames - use TCustomDAConnection.GetStoredProcNames instead.
- GetFieldNames - not supported by SDAC, use TMSMetaData instead.
- OpenSchema - not supported by SDAC, use TMSMetaData instead.
- RollbackTrans - use TCustomDAConnection.Rollback instead.
- OnBeginTransComplete, OnCommitTransComplete, OnConnectComplete, OnDisconnect, OnExecuteComplete, OnRollbackTransComplete, OnWillConnect, OnWillExecute - not supported by SDAC.
TADOCommand
- CommandObject - not supported by SDAC.
- CommandText - use TCustomDASQL.SQL.Text.
- CommandType - not supported by SDAC, the behaviour is similar to cmdText.
- ConnectionString - use P:Devart.Sdac.TCustomMSConnection.ConnectString instead.
- ExecuteOptions - SQL OLE DB provider does not support asynchronous execution of the commands. If you need to break execution of a query from another thread, use M:Devart.Sdac.TMSSQL.BreakExec().
- Parameters use TCustomDASQL.Params.
- Prepared use TCustomDASQL.Prepare/TCustomDASQL.Unprepare.
- Properties, States - not supported by SDAC.
- Cancel use M:Devart.Sdac.TMSSQL.BreakExec() call from another thread.
TADOQuery, TADODataSet
- BlockReadSize, CacheSize - use FetchRows instead.
- ConnectionString - use P:Devart.Sdac.TCustomMSConnection.ConnectString instead.
- DesignerData - not supported by SDAC.
- EnableBCD use TCustomMSDataSet.Options.EnableBCD.
- ExecuteOptions - SQL OLE DB provider does not support asynchronous execution of the commands. If you need to break execution of a query from another thread, use M:Devart.Sdac.TMSSQL.BreakExec().
- FilterGroup not supported by SDAC.
- Indexname a list of fields for local sorting. See TMemDataSet.IndexFieldNames.
- IndexFieldCount, IndexFields - not supported by SDAC.
- LockType not supported by SQL Server.
- MarshalOptions - not supported by SQL Server.
- MaxRecords - not supported by SQL Server.
- Parameters use TCustomDADataSet.Params.
- Prepared use TCustomDADataSet.Prepare/TMemDataSet.UnPrepare.
- Properties not supported by SDAC.
- RecordSet, RecordSetState - not supported by SDAC.
- RecordSize not supported by SDAC.
- RecordStatus - use TMemDataSet.UpdateStatus.
- Sort use TMemDataSet.IndexFieldNames.
- ExecSQL use TCustomDADataSet.Execute instead.
- CancelBatch - not supported by SDAC.
- Clone not supported by SDAC.
- DeleteRecords - not supported by SDAC.
- FilterOnBookmark - use Filter, FilterSQL instead.
- GetBlobFieldData - not supported by SDAC.
- GetDetailLinkFields - use TCustomDADataSet.DetailFields.
- IsSequenced - not supported by SDAC.
- LoadFromFile, SaveToFile - not supported by SDAC.
- NextRecordset - use TCustomMSDataSet.OpenNext.
- Requery TDataSet.Refresh.
- Seek not supported by SQL OLE DB provider.
- Supports not supported by SDAC.
- UpdateBatch - not supported by SDAC.
- OnEndOfRecordset, OnFetchComplete, OnFetchProgress, OnFieldChangeComplete, OnMoveComplete, OnRecordChangeComplete, OnRecordsetChangeComplete, OnRecordsetCreate, OnWillChangeField, OnWillChangeRecord, OnWillChangeRecordset, OnWillMove - specific ADO properties, not supported by SDAC.
TADOStoredProc
TADOTable
- TableDirect - not supported by MS OLE DB provider.