ServerMode: DalServerMode;
ServerMode: Prognoz.Platform.Interop.Dal.DalServerMode;
The ServerMode property returns type of DBMS server, with which connection is established.
If connection is established by means of one of the drivers OLE DB installed in the operating system, the Driver property returns OLEDB. In this case the ServerMode property allows to determine the type of DBMS family, which driver was used.
NOTE. The property does not return particular driver model.
Sub CheckServer(Connection: IDalConnection2);
Begin
If Connection.Driver = "OLEDB" Then
Select Case Connection.ServerMode
Case DalServerMode.ORCL: //Further work with connection and creating of queries with Oracle syntax
Case DalServerMode.MSSQL: //Further work with conenction and creating of queries with Microsoft SQL Server syntax
//...
//Checking other types...
//...
End Select;
End If;
End Sub CheckServer;
The specified function can be used to check the type of DBMS server if connection is establshed by means of any of OLE DB drivers.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Sub CheckServer(Connection: IDalConnection2);
Begin
If Connection.Driver = "OLEDB" Then
Select Case Connection.ServerMode
Case DalServerMode.dsmORCL: //Further work with connection and creating of queries with Oracle syntax
Case DalServerMode.dsmMSSQL: //Further work with connection and creating of queries with Microsoft SQL Server syntax
//...
//Checking other types...
//...
End Select;
End If;
End Sub;
See also: