Connecting to SQL Server LocalDB in Delphi -
i have .mdf
database file, want connect file adoconnection
, sql server localdb provider
my connection string looks :
data source=(localdb)\v11.0;integrated security=sspi;attachdbfilename="mymdffileaddress";
but when try connect, error shown:
an attempt attach auto-named database file "mdf file" failed. database same name exists, or specified file
i have tried many ways, error above shown!
i have installed sqllocaldb
, sql server native client 11.0
on machine can connect own created instance on localdb , database, when want connect file in machine , use default instance , attachdbfilename
, error shown
i copied .mdf
file default instance folder of localdb , tried connect, same error shown
i searched lot found no correct answer !
i'm using delphi xe 6
did try this?
data source=(localdb)\v11.0;integrated security=true;attachdbfilename=|datadirectory|\"mymdffileaddress.mdf";initial catalog=yourdatabasename;providername="system.data.sqlclient"
is there database instance (v11.0) in machine? open command prompt , type verify:
sqllocaldb info
Comments
Post a Comment