Re: SQLExpress



Shane (shane@xxxxxxxxxxxxxxxxxxxx) writes:
I am trying to write an application for a MSSQL database, using SQL
Express, and Visual Studio (Express edition)

I tried to connect to an existing database (named testing) but to no
avail. Visual Studio claims the database does not exist.

Sorry about that, a simple search turned it up. New problem however,
when I go to connect to it I get the following error.

Unable to open the physical file "C:\Program Files\Micrososft SQL
Server\MSSQL.1\MSSQL\Data\testing.mdf", Operating System error 32: "32(The
process cannot be access the file because it is being used by another
process.)".
An attempt to attach an auto-named database for file C:\Program
Files\Micrososft SQL Server\MSSQL.1\MSSQL\Data\testing.mdf failed. A
database with the same name exists, or specified file cannot be opened, or
it is located on UNC share.

The error message indicates that the file is already open, presumably
by an SQL Server instance.

One possibility is that you have installed several instances of SQL Server
on your machine, not only an Express instance, and this database actually
belongs to some other instance.

But it could also be that you have created this database previously
from Mgmt Studio Express or similar and your Express instance is running.
But SQL Express has this feature User Instance, which does not exist in
any other SQL Server edition. A user instance is cloned off from the main
Express instance. It could be that Visual Studio starts up a user
instance, and then you cannot attach the database to the user instance,
if it's already attached to the main instance.

You may be better off asking a in newsgroup devoted to Visual Studio,
since this depends on what Visual Studio is doing behind the covers.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... Create a Connection object and pass in a ConnectionString to ... manage the database table you reference. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Thanks for posting it. ... Hitchhiker's Guide to Visual Studio and SQL Server ... manage the database table you reference. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Visual Studio but not to VS 2003. ... Create a Connection object and pass in a ConnectionString to address ... manage the database table you reference. ... Yep, my latest book can help too, but mostly if you're targeting SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: using Membership on production server (Copy Web Site tool) - U
    ... I was aware of what "user instance" are and since I do want to have all ... "User instance" can let you use sql server mdf database file without ... authentication(instead of putting username/password in connection string). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: MS Access DAO -> ADO.NET Migration
    ... full SQL Server and I see the logic you explained in a multi user ... allow two users to access the same database file Read/Write at any given ... The book was a pleasure to read after the gibberish that Microsoft 'puts ... Hitchhiker's Guide to Visual Studio and SQL Server ...
    (microsoft.public.dotnet.framework.adonet)