SDAC 8.1.7 problem with MSOLEDBSQL.1 in ConnectString

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jabu
Posts: 16
Joined: Fri 05 Nov 2004 11:47

SDAC 8.1.7 problem with MSOLEDBSQL.1 in ConnectString

Post by jabu » Wed 19 Sep 2018 10:12

Hello,
I try use MSOLEDBSQL.1 in ConnectString (created in design mode where all is ok) in runtime

MSConnection1.ConnectString:= 'Provider=MSOLEDBSQL.1;Data Source= ...'

and got error message "Invalid connection parameter value: Provider=MSOLEDBSQL.1"

I have source code version of SDAC than I correct this problem in MSConnectionString.pas

function TCustomMSConnectionStringBuilder.ConvertStrToVar(Param: TConnectionStringParam; const Value: string): Variant;
var
s: string;
begin
case Param.Code of
prProvider: begin
s := UpperCase(Value);
if (s <> SProviderTDS) and
(s <> SProviderSQLOLEDB) and
(s <> SProviderMSOLEDBSQL) and
(s <> SProviderNativeClient) and
(s <> SProviderNativeClient10) and
(s <> SProviderNativeClient11) and
(s <> SProviderCompact) and
(s <> SProviderCompact35) and
(s <> SProviderCompact40)
then
raise EConnectionStringError.CreateFmt(SInvalidConnectParamValue, [Param.Name, Value]);

Result := GetProvider(s);
end;
else
Result := inherited ConvertStrToVar(Param, Value);
end;
end;

Please correct this for users who don't have the source code.

Regards, jabu

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: SDAC 8.1.7 problem with MSOLEDBSQL.1 in ConnectString

Post by Stellar » Wed 19 Sep 2018 11:53

Thank you for the information. We have fixed the issue, and the fix will be included in the next SDAC build.

Post Reply