login

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
smarreco
Posts: 9
Joined: Tue 08 Dec 2015 19:08

login

Post by smarreco » Tue 08 Dec 2015 19:19

I'm trying to establish a connection to a SQL Server Compact.
According to the manual , I should specify the database name at the TMSCompactConnection object.
Something like c:\test.sdf. But what kind of name is this?
MSSQL Server database files are _Data and _Log .MDF files.

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Re: login

Post by Ludek » Wed 09 Dec 2015 15:12

I think you cannot use TMSCompactConnection for connecting to regular MS SQL database (.mdf & .ldf is used by "normal" sql server - enterprise, standard, express; NOT compact).
You should use TMSConnection to connect to running SQL instance with those files attached as database.

smarreco
Posts: 9
Joined: Tue 08 Dec 2015 19:08

Re: login

Post by smarreco » Thu 10 Dec 2015 18:11

Bingo!

Thanks, Ludek.

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: login

Post by azyk » Fri 11 Dec 2015 11:21

Ludek is right. The TMSCompactConnection component supports connection to SQL Server Compact Edition only (.sdf database file).

To connect to the database, whose files (.mdf and .ldf) are not attached to the running SQL Server instance, you should set the TMSConnection.Options.InitialFileName property value to the full path and full .mdf file name before connection. See more details about the InitialFileName property in our documentation:
https://www.devart.com/sdac/docs/?devar ... lename.htm .

Post Reply