sql server - ADOConnection cant get table names on SQL LocalDB -


i have sql database mdf file , want connect file adoconnection , sql client 11.0 provider

adoconnection connects there no table !

adoconnection.gettablenames() returns ""

my code :

 adoconnection1.connectionstring := 'provider=sqlncli11.1;integrated security=sspi;persist security info=false;user id="";data source=(localdb)\v11.0;initial file name="";server spn="";'                +'attachdbfilename="g:\projects\delphi\pasargad insurance\db\main.mdf";';  adoconnection1.connected := true;   adoconnection1.gettablenames(redit.lines); 

when connect database sql server managment studio, tables exists

edit :

i removed "initial file name" , adoconnection failed connect :

an attempt attach auto-named database file "g:\projects\delphi\pasargad insurance\db\main2.mdf" failed. database same name exists, or specified file cannot opened, or located on unc share

i switched tracing of localdb off, copied database file , deleted main database sqlserver managment studio , , tried again connect same error shown.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -