PC Review


Reply
Thread Tools Rate Thread

Connect To .mdf file on Network?

 
 
PvdG42
Guest
Posts: n/a
 
      13th Nov 2008
Attempting to create a DataSource (SQL Server database file) for a C#
Windows Forms app where the project/solution is on one machine and the .mdf
is on a second machine accessible through a simple "Microsoft Network". The
drive and its content are accessible from the project machine, but the "Test
Connection" button in the DataSource Wizard gives this error message:

The file \\<machine name>\e\SQL_DatabaseFiles\Cottages.mdf is on a network
path that is not supported for database files.
An attempt to attach an auto-named database for file \\<machine
name>\e\SQL_DatabaseFiles\Cottages.mdf failed. A database with the same name
exists, or specified file cannot be opened, or it is located on UNC share.

Visual Studio 2008 and SQL Server Express 2005.
Is there a way to configure VS to allow this, or is there a workaround?



 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      13th Nov 2008
Is the MDF attached to an instance of SQL Server on the other box? If so,
there is no way you can attach it to your local instance. In that case, you
can create a linked server, although I am not sure Express allows linked
servers. If not, you need a full version of SQL Server.

If it is not attached, you might try creating a "local" drive using a UNC
path and attaching. I have a feeling there is someting built in the SQL
engine to prevent this, however, as SQL intimately manages the MDF and LDF
files and your suggestion is far from optimal for intimate management.

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
"PvdG42" <(E-Mail Removed)> wrote in message
news:3ED5ACE8-595C-4612-8D2B-(E-Mail Removed)...
> Attempting to create a DataSource (SQL Server database file) for a C#
> Windows Forms app where the project/solution is on one machine and the
> .mdf is on a second machine accessible through a simple "Microsoft
> Network". The drive and its content are accessible from the project
> machine, but the "Test Connection" button in the DataSource Wizard gives
> this error message:
>
> The file \\<machine name>\e\SQL_DatabaseFiles\Cottages.mdf is on a network
> path that is not supported for database files.
> An attempt to attach an auto-named database for file \\<machine
> name>\e\SQL_DatabaseFiles\Cottages.mdf failed. A database with the same
> name
> exists, or specified file cannot be opened, or it is located on UNC share.
>
> Visual Studio 2008 and SQL Server Express 2005.
> Is there a way to configure VS to allow this, or is there a workaround?
>
>
>


 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      13th Nov 2008
On Thu, 13 Nov 2008 19:22:35 +0100, "Patrice" <http://www.chez.com/scribe/> wrote:

¤ Try :
¤ http://support.microsoft.com/kb/304261/en-us (in particular it seems you
¤ have to position a trace flagf to by pass this check).
¤
¤ Of course this is quite an unexpected usage for SQL Server. Do this only if
¤ you have a compelling reason for not using a client server architecture...

Yes, and the potential for database corruption is pretty compelling reason not to. ;-)


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
PvdG42
Guest
Posts: n/a
 
      14th Nov 2008

"Gregory A. Beamer" <(E-Mail Removed)> wrote in message
news:34A07D94-1261-4637-B6DE-(E-Mail Removed)...
> Is the MDF attached to an instance of SQL Server on the other box? If so,
> there is no way you can attach it to your local instance. In that case,
> you can create a linked server, although I am not sure Express allows
> linked servers. If not, you need a full version of SQL Server.
>
> If it is not attached, you might try creating a "local" drive using a UNC
> path and attaching. I have a feeling there is someting built in the SQL
> engine to prevent this, however, as SQL intimately manages the MDF and LDF
> files and your suggestion is far from optimal for intimate management.
>
> --
> Gregory A. Beamer
> MVP: MCP: +I, SE, SD, DBA
>

Thanks very much for the suggestion.
The MDF is not attached to an instance of SQL Server, and unfortunately,
cannot be (according to the student who brought me this rather bizarre
scenario from his DOD workplace). The deal appears to be that he is supposed
to develop an app that will be used by ~ 20 - 30 people concurrently and
needs a single shared database instance, but that no real server (i.e. a SQL
Server instance available through a network) can be provided. He did a
prototype using an Access database file, but thinks that will not be good
enough for the amount of data involved or the potential number of concurrent
users.


 
Reply With Quote
 
PvdG42
Guest
Posts: n/a
 
      14th Nov 2008

"Patrice" <http://www.chez.com/scribe/> wrote in message
news:78AE278B-E14E-4A15-A0EC-(E-Mail Removed)...
> Try :
> http://support.microsoft.com/kb/304261/en-us (in particular it seems you
> have to position a trace flagf to by pass this check).
>
> Of course this is quite an unexpected usage for SQL Server. Do this only
> if you have a compelling reason for not using a client server
> architecture...
>
> --
> Patrice
>


Patrice and Paul,

Thanks very much for your suggestions and comments. I agree completely that
it's all wrong. However, to reveal the origin of the scenario:

The MDF is not attached to an instance of SQL Server, and unfortunately,
cannot be (according to the student who brought me this rather bizarre
scenario from his DOD workplace). The deal appears to be that he is supposed
to develop an app that will be used by ~ 20 - 30 people concurrently and
needs a single shared database instance, but that no real server (i.e. a SQL
Server instance available through a network) "can be provided". He did a
prototype using an Access database file, but thinks that will not be good
enough for the amount of data involved or the potential number of concurrent
users.

I'll pass your suggestion and concerns along to him.

 
Reply With Quote
 
PvdG42
Guest
Posts: n/a
 
      14th Nov 2008

"Patrice" <http://www.chez.com/scribe/> wrote in message
news:893CB3B7-D978-431C-AD3C-(E-Mail Removed)...
> So instead of using an Access file you'll need :
> - to have SQL Server Express installed on 20-30 machines
> - each of those instance would point to the same mdf file
> - assuming this is possible which is afaik very unlikely you'll use the
> file throught a network share exactly the same way Access would. SQL
> Server can be magically better but because only "statements and data" are
> sent over the wire and the server process that listen server side is the
> only one allowed to mess with the file rather than to use a file using a
> network share. So you annihilate the architecture benefit brought by SQL
> Server.
>
> So I would either :
> - stick to Access
> - or use SQL Server as it should
>
> Here it looks like an overcomplicated "solution" that will bring all the
> problems of both solutions (and I don't think this is even possible
> anyway).
>
> --
> Patrice
>

More excellent advice!
Thanks again, Patrice. I'll pass it along.

 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      15th Nov 2008
It seems a better option would be to set up a SQL instance with a WCF
service for access. Then shut off port 1433 access to the server,
essentially forcing everyone through the web service. Then write the clients
to hit the service. Solves the "we cannot install a server due to security"
and still alllows the server to be used as it should.

Another option is educate how SQL Server can be secured.

The third is to find a new carpenter's job, as this company is asking him to
build a house, but with no building materials.

I agree with the Access issue. It is easy to outgrow. There are some other
file based databases, but you will generally find you outgrow them rather
quickly or they need some type of server on top of them.

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
"PvdG42" <(E-Mail Removed)> wrote in message
news:FB9AD266-55AB-44AF-A0D1-(E-Mail Removed)...
>
> "Gregory A. Beamer" <(E-Mail Removed)> wrote in message
> news:34A07D94-1261-4637-B6DE-(E-Mail Removed)...
>> Is the MDF attached to an instance of SQL Server on the other box? If so,
>> there is no way you can attach it to your local instance. In that case,
>> you can create a linked server, although I am not sure Express allows
>> linked servers. If not, you need a full version of SQL Server.
>>
>> If it is not attached, you might try creating a "local" drive using a UNC
>> path and attaching. I have a feeling there is someting built in the SQL
>> engine to prevent this, however, as SQL intimately manages the MDF and
>> LDF files and your suggestion is far from optimal for intimate
>> management.
>>
>> --
>> Gregory A. Beamer
>> MVP: MCP: +I, SE, SD, DBA
>>

> Thanks very much for the suggestion.
> The MDF is not attached to an instance of SQL Server, and unfortunately,
> cannot be (according to the student who brought me this rather bizarre
> scenario from his DOD workplace). The deal appears to be that he is
> supposed to develop an app that will be used by ~ 20 - 30 people
> concurrently and needs a single shared database instance, but that no real
> server (i.e. a SQL Server instance available through a network) can be
> provided. He did a prototype using an Access database file, but thinks
> that will not be good enough for the amount of data involved or the
> potential number of concurrent users.
>
>


 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      15th Nov 2008
BTW, you can also set up SQL Express (I know the employer states NO SERVER,
but ...) and then have it set up so the security only allows application
access (beyond SA, which you really cannot get rid of). You then set up the
application clients on the boxes and still have the server.

You cannot attach multiple SQL Express instances to the same MDF. You can
with SQL Server Enterprise, as a cluster, but that would be an expensive
option to use a networked MDF file. It would also not be the proper way to
cluster. :-)

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
"PvdG42" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Patrice" <http://www.chez.com/scribe/> wrote in message
> news:893CB3B7-D978-431C-AD3C-(E-Mail Removed)...
>> So instead of using an Access file you'll need :
>> - to have SQL Server Express installed on 20-30 machines
>> - each of those instance would point to the same mdf file
>> - assuming this is possible which is afaik very unlikely you'll use the
>> file throught a network share exactly the same way Access would. SQL
>> Server can be magically better but because only "statements and data" are
>> sent over the wire and the server process that listen server side is the
>> only one allowed to mess with the file rather than to use a file using a
>> network share. So you annihilate the architecture benefit brought by SQL
>> Server.
>>
>> So I would either :
>> - stick to Access
>> - or use SQL Server as it should
>>
>> Here it looks like an overcomplicated "solution" that will bring all the
>> problems of both solutions (and I don't think this is even possible
>> anyway).
>>
>> --
>> Patrice
>>

> More excellent advice!
> Thanks again, Patrice. I'll pass it along.


 
Reply With Quote
 
PvdG42
Guest
Posts: n/a
 
      15th Nov 2008

"Gregory A. Beamer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> BTW, you can also set up SQL Express (I know the employer states NO
> SERVER, but ...) and then have it set up so the security only allows
> application access (beyond SA, which you really cannot get rid of). You
> then set up the application clients on the boxes and still have the
> server.
>
> You cannot attach multiple SQL Express instances to the same MDF. You can
> with SQL Server Enterprise, as a cluster, but that would be an expensive
> option to use a networked MDF file. It would also not be the proper way to
> cluster. :-)
>
> --
> Gregory A. Beamer
> MVP: MCP: +I, SE, SD, DBA
>
> Blog:
> http://feeds.feedburner.com/GregoryBeamer
>

Thanks again for the additional insights.
Perhaps the cost of something like aSQL EE licanse will cause the
decisionmakers to rethink their position :-)

 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      15th Nov 2008

"PvdG42" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Thanks again for the additional insights.
> Perhaps the cost of something like aSQL EE licanse will cause the
> decisionmakers to rethink their position :-)


or at least give you real concerns that you can fight with proper
documentation. ;-)


--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
weird network error - cannot connect to network after joining domain hkmlam@gmail.com Windows XP Networking 3 12th Oct 2007 03:01 AM
Can't connect to Internet using IE or other browser, but network file sharing works morkmeister@gmail.com Windows XP Networking 4 22nd Oct 2005 10:47 PM
Windows 98 won't connect w/ XP printer on network; file sharing OK =?Utf-8?B?TFAgc3RlcmVv?= Windows XP Networking 2 9th Dec 2004 04:49 AM
Automatically connect to network shares & remote file storage in XP Pro SP1 Noozer Windows XP Help 8 6th May 2004 03:57 PM
Unable to connect to file share using add network places frc7777 Windows XP Networking 0 29th Aug 2003 04:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:01 AM.