Format of connection string

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kun_1983
Posts: 1
Joined: Fri 24 Sep 2010 09:05

Format of connection string

Post by kun_1983 » Fri 24 Sep 2010 11:46

Hello,

when i put into connection string some national specific characters, e.g. Data Source=ÁŠČ-PC; i get following exception: "invalid character in non-quoted parameter value"

When i enclose data source in double quotes, all works fine - Data Source="ÁŠČ-PC";

Is this approach correct? Should be some parameters of connection string in double quotes?

In your example Demos\Win32\TechnologySpecific\MSSQLCompact\ you build connection string as follows: ConnString := ConnString + 'Data Source="' + edDBName.Text + '"';

AndreyZ

Post by AndreyZ » Mon 27 Sep 2010 08:03

Hello,

This is correct behaviour of the TMSConnection component. Some characters are reserved or not allowed. This is SQL Server and OLEDB restrictions.

Post Reply