locked
Can't access LocalDB for a database stored on a different folder RRS feed

  • Question

  • Hi Everyone,

    I have a .MDB database stored in the folder C:\Users\Quecu\OneDrive\Documents\Visual Studio 2017\Projects\IP2Geo.

    However, when I try to use Microsoft SQL Server Management Studio to access the database it only show this one on the LocalDB.

    Why?


    MRM256

    Sunday, June 14, 2020 11:37 PM

Answers

  • Hi MRM256,

    >> Now I just need to figure out how to export data from one LocalDB to the other.

    You can try to use Generate Scripts as below screenshot.  Change the database name when run the script to create data.


    Best regards,
    Cathy 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, June 16, 2020 9:01 AM

All replies

  • Hi MRM256,


    What is your connection string? Did you connect to a specific database by using the file name, connect using a connection string similar to Server=(LocalDB)\MSSQLLocalDB; Integrated Security=true ;AttachDbFileName=C:\test\test3.mdf? Did you specify the file location of mdf ?

    Please do not specific database, try to use the connection string Server=(localdb)\MSSQLLocalDB;Integrated Security=true to connect local DB.

    Please refer to Start LocalDB and connect to LocalDB.

    Best regards,
    Cathy 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com





    Monday, June 15, 2020 3:13 AM
  • Hi Cathy,

    I am trying to access the database using MS SQL Server Management Studio(SSMS). I connect to the SQL Server Express DBs through SSMS.

    I connect like so:

    That is it. Once it is connected I get this:

    Once I managed to get two different LocalDBs to show up, but once I left SSMS the second LocalDB disappeared, which I have still not have been able to repeat(couldn't do it again).

    So it seems to be a SSMS related problem, not a connection string.

    UPDATE--------------------------

    I think I know why SSMS will only show the first LocalDB created using Visual Studio.

    I open up my Visual Studio project and open the Serviced-based Database using Server explorer.

    Then I opened Microsoft SQL Sever Management Studio(SSMS) and connected to SQL Server Express(LocalDB).

    After SSMS connects it will then show TWO different LocalDBs: One for the CounterStrike Project, and the other for the IP2Geo project.

    Now I just need to figure out how to export data from one LocalDB to the other.

    Thanks,


    MRM256


    • Edited by MRM256 Monday, June 15, 2020 4:02 PM Found out why.
    Monday, June 15, 2020 2:39 PM
  • Hi MRM256,

    >> Now I just need to figure out how to export data from one LocalDB to the other.

    You can try to use Generate Scripts as below screenshot.  Change the database name when run the script to create data.


    Best regards,
    Cathy 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, June 16, 2020 9:01 AM
  • Now I just need to figure out how to export data from one LocalDB to the other.

    Thanks Cathy. That did it.


    MRM256

    • Marked as answer by MRM256 Wednesday, June 17, 2020 2:22 PM
    • Unmarked as answer by Naomi N Wednesday, June 17, 2020 3:23 PM
    Wednesday, June 17, 2020 2:22 PM