TMSSQLConnection class
Microsoft SQL Server database connector.
Declaration
TMSSQLConnection = class(TSQLConnection)Inheritance
Descends from it: TSybaseConnection
Description
Connector to Microsoft SQL Server databases.
Requirements:
MS SQL Server Client Library is required (ntwdblib.dll)
- or -
FreeTDS (dblib.dll)
Older FreeTDS libraries may require freetds.conf: (http://www.freetds.org/userguide/freetdsconf.htm)
[global]
tds version = 7.1
client charset = UTF-8
port = 1433 or instance = ... (optional)
dump file = freetds.log (optional)
text size = 2147483647 (optional)
Known problems:
- CHAR/VARCHAR data truncated to column length when encoding to UTF-8 (use NCHAR/NVARCHAR instead or CAST char/varchar to nchar/nvarchar)
- Multiple result sets (MARS) are not supported (for example when SP returns more than 1 result set only 1st is processed)
- DB-Library error 10038 "Results Pending": set TSQLQuery.PacketRecords=-1 to fetch all pending rows
- BLOB data (IMAGE/TEXT columns) larger than 16MB are truncated to 16MB: (set TMSSQLConnection.Params: 'TEXTSIZE=2147483647' or execute 'SET TEXTSIZE 2147483647')
Properties
Password | published | Password used when authenticating on the database server. |
Transaction | published | Default transaction. |
UserName | published | The username for authentication on the database server. |
CharSet | published | The character set to be used in this database. |
HostName | published | Host and optionally port or instance. |
Connected | published | Is the connection active. |
Role | published | Role for user. |
DatabaseName | published | The name of the database to which connection is required. |
KeepConnection | published | Keep connection alive. |
LoginPrompt | published | Show login prompt. |
Params | published | Extra connection parameters. |
Methods
GetHandle | protected | |
GetAsSQLText | protected | |
GetConnectionCharSet | protected | |
DoInternalConnect | protected | |
DoInternalDisconnect | protected | |
AllocateCursorHandle | protected | |
DeAllocateCursorHandle | protected | |
AllocateTransactionHandle | protected | |
GetTransactionHandle | protected | |
StartDBTransaction | protected | |
Commit | protected | |
Rollback | protected | |
CommitRetaining | protected | |
RollbackRetaining | protected | |
StrToStatementType | protected | |
PrepareStatement | protected | |
UnPrepareStatement | protected | |
RowsAffected | protected | |
RefreshLastInsertID | protected | |
AddFieldDefs | protected | |
Fetch | protected | |
LoadField | protected | |
LoadBlobIntoBuffer | protected | |
FreeFldBuffers | protected | |
UpdateIndexDefs | protected | |
GetSchemaInfoSQL | protected | |
Create | public | Create a new instance of TMSSQLConnection. |
GetConnectionInfo | public | Return some information about the connection. |
CreateDB | public | Create a new MS SQL database. |
DropDB | public | Drop a MS SQL database. |
Events
OnLogin | published | Called when logging in. |
Inherited
From TSQLConnection (47)
AddFieldDef AddFieldToUpdateWherePart ApplyFieldUpdate ApplyRecUpdate CodePage ConnOptions ConstructDeleteSQL ConstructInsertSQL ConstructRefreshSQL ConstructUpdateSQL CreateCustomQuery Destroy DoConnect EndTransaction Execute ExecuteDirect FieldNameQuoteChars GetAsString GetDBInfo GetFieldNames GetNextValue GetNextValueSQL GetObjectNames GetProcedureNames GetSchemaNames GetSequenceNames GetStatementInfo GetTableNames Handle HasTable InitialiseUpdateStatement Log LogEvent LogEvents LogParams MaybeConnect OnLog Options Port PortParamName RegisterStatement SetTransaction StartImplicitTransaction StartTransaction Statements UnPrepareStatements UnRegisterStatement
From TDatabase (12)
CheckConnected CheckDisConnected CloseDataSets CloseTransactions Directory DoDisconnect GetConnected GetDataset GetDataSetCount IsSQLBased TransactionCount Transactions
From TCustomConnection (20)
AfterConnect AfterDisconnect BeforeConnect BeforeDisconnect Close CloseForDestroy DataSetCount DataSets DoCloseError DoLoginPrompt ForcedClose GetLoginParams InternalHandleException Loaded OnCloseError Open SetConnected SetForcedClose SetLoginParams StreamedConnected
From TComponent (73)
_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loading Name Notification ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState
From TPersistent (5)
Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers
From TObject (37)
AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
