Answered by:
Can I make use of LocalDB for my connections

Question
-
Hello, I'm working on a project in Visual Studio Professional 2010 (Visual Basic). We have several workstations, connected to one server. My project is on my workstation, the databases to which i connect are on the networkdrive on the server. I connected them till now by SQL Server 2008 R2. Now, I have installed Visual Studio Professional 2012 on my workstation and we have upgraded the server to Windows server 2012 (with SQL Server 2012 installed). I understand that LocalDB is only for connection with local stored databases ? In my case, does this mean i can't make use of LocalDB to connect to my databases on the networkdrive ? Do i have to make use of \SQLEXPRESS instead ?Saturday, June 1, 2013 10:08 AM
Answers
-
Hello,
It could work but it is not supported. SQL Server Express is not designed to work with database files located on network shares.
Hope this helps.Regards,
Alberto Morillo
SQLCoffee.com- Proposed as answer by Ed Price - MSFTMicrosoft employee Monday, June 3, 2013 7:12 AM
- Marked as answer by Fanny Liu Monday, June 10, 2013 7:35 AM
Sunday, June 2, 2013 9:11 PM -
Hello,
If that server is not a domain controller, you can install a SQL Server Express instance there, enable TCP/IP on the instance, configure Windows Firewall, copy your database to a local drive and attach your database. Everybody on the office will be able to access the database.
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com- Marked as answer by Fanny Liu Monday, June 10, 2013 7:35 AM
Tuesday, June 4, 2013 6:49 PM
All replies
-
Hello,
Database files cannot be located on a network drive if you are using LocalDB. It is not supported.
SQL Server Express does not support opening a database file located on a network drive also.You can copy database files to a local disk drive, attach them to a local SQL Server Express instance, start SQL Server Browser service, enable TCP/IP, and allow other to connect to your SQL Server Express instance.
Configure Windows Firewall also.
Hope this helps.Regards,
Alberto Morillo
SQLCoffee.comSunday, June 2, 2013 3:40 AM -
Alberto,
Alberto, thanks for your help ...
So, as i understand, the other workstations would have the possibility to connect to my local SQL Server Express
instance, and to do all the operations on the database on my workstation-drive ? Can I use in that case the
'LocalDB', or do I need to use the common SQL Server Express ?Would it also be an option to store, the databases and the whole project, on the networkdrive, and to let start
the workstations the EXE-file of the project on the server, to do all the operations on the databases ?Till now, I've not tested yet the working of my project with several users in the network.
But, at this moment, the database files are stored on the server, on the networkdrive (G:\).
The Visual Basic project succeeds to do all the operations on the databases (reading, changing,
deleting, add data, ...) (Sql Server 2008 R2), when my project is saved on the networkdrive (G:\).
However, when I copy my project to my workstation (local C:\-disk), and the database files stay stored on
the G:\, it's also works great. How is that possible ?
Sunday, June 2, 2013 11:49 AM -
-
Hello,
It could work but it is not supported. SQL Server Express is not designed to work with database files located on network shares.
Hope this helps.Regards,
Alberto Morillo
SQLCoffee.com- Proposed as answer by Ed Price - MSFTMicrosoft employee Monday, June 3, 2013 7:12 AM
- Marked as answer by Fanny Liu Monday, June 10, 2013 7:35 AM
Sunday, June 2, 2013 9:11 PM -
So, I can' t use neither LocalDB, neither SQL ServerExpress ? I'm getting a little bit nervous ...
What would be 'a' solution, or the best solution to organize my environment :
I have several workstations (windows 7 prof), who are logged in on a server (windows server 2012).
Each workstation must have the possibility to start my project, and to do operations on my
databases (.mdf files).Project in Visual Basic : where to store the project ? On each workstation or on the server ?
Database files : where to store them ?
How to arrange my connections with the databases ? Till now, I made use of the connectionstrings
between my DataSources and my database files (DataSource=\SQLEXPRESS:AttachDbfilename=G:\...),
with SQL Server 2008 R2.
Monday, June 3, 2013 7:00 AM -
Hello,
If that server is not a domain controller, you can install a SQL Server Express instance there, enable TCP/IP on the instance, configure Windows Firewall, copy your database to a local drive and attach your database. Everybody on the office will be able to access the database.
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com- Marked as answer by Fanny Liu Monday, June 10, 2013 7:35 AM
Tuesday, June 4, 2013 6:49 PM