According to this article https://docs.microsoft.com/en-us/sql/co ... sql-server i use MSOLEDBSQL as provider in connection string (probably latest generation of OleDB driver). But in unit ZDBCOleDBUtils function ProviderNamePrefix2ServerProvider does not know the name prefix 'MSOLEDBSQL'.
Code: Select all
function ProviderNamePrefix2ServerProvider(const ProviderNamePrefix: String): TZServerProvider;
type
TDriverNameAndServerProvider = record
ProviderNamePrefix: String;
Provider: TZServerProvider;
end;
const
KnownDriverName2TypeMap: array[0..12] of TDriverNameAndServerProvider = (
(ProviderNamePrefix: 'ORAOLEDB'; Provider: spOracle),
(ProviderNamePrefix: 'MSDAORA'; Provider: spOracle),
(ProviderNamePrefix: 'SQLNCLI'; Provider: spMSSQL),
(ProviderNamePrefix: 'SQLOLEDB'; Provider: spMSSQL),
(ProviderNamePrefix: 'SSISOLEDB'; Provider: spMSSQL),
//(ProviderNamePrefix: 'MSDASQL'; Provider: spMSSQL), ODBC proivider for everything
(ProviderNamePrefix: 'MYSQLPROV'; Provider: spMySQL),
(ProviderNamePrefix: 'IBMDA400'; Provider: spAS400),
(ProviderNamePrefix: 'IFXOLEDBC'; Provider: spInformix),
(ProviderNamePrefix: 'MICROSOFT.JET.OLEDB'; Provider: spMSJet),
(ProviderNamePrefix: 'MICROSOFT.ACE'; Provider: spMSJet),
(ProviderNamePrefix: 'IB'; Provider: spIB_FB),
(ProviderNamePrefix: 'POSTGRESSQL'; Provider: spPostgreSQL),
(ProviderNamePrefix: 'CUBRID'; Provider: spCUBRID)
);
var
I: Integer;
ProviderNamePrefixUp: string;
begin
Result := spUnknown;
ProviderNamePrefixUp := UpperCase(ProviderNamePrefix);
for i := low(KnownDriverName2TypeMap) to high(KnownDriverName2TypeMap) do
if StartsWith(ProviderNamePrefixUp, KnownDriverName2TypeMap[i].ProviderNamePrefix) then begin
Result := KnownDriverName2TypeMap[i].Provider;
Break;
end;
end;