SQLExpress
am 25.05.2007 05:43:28 von shane
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.
Any ideas?
TIA
--
Q: What is the difference between a mathematician and a philosopher?
A: The mathematician only needs paper, pencil, and a trash bin for his
work - the philosopher can do without the trash bin...
Re: SQLExpress
am 25.05.2007 06:04:14 von shane
Shane wrote:
> 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.
>
> Any ideas?
> TIA
>
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.
--
It is only two weeks into the term that, in a calculus class, a student
raises his hand and asks: "Will we ever need this stuff in real life?"
The professor gently smiles at him and says: "Of course not - if your real
life will consist of flipping hamburgers at MacDonald's!"
Re: SQLExpress
am 26.05.2007 11:16:41 von Erland Sommarskog
Shane (shane@weasel.is-a-geek.net) 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@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downlo ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx