PC Review


Reply
Thread Tools Rate Thread

Connecting to Database

 
 
Miro
Guest
Posts: n/a
 
      14th Feb 2008
I cant make heads or tails of what I am missing.
I thought i had the answer to this yesterday but apparently I'm still
missing something.

First I needed to get a copy of northwind database, so I was able to
download it from here:
http://www.microsoft.com/downloads/d...displaylang=en

-Im Running Vista
I then went into my SQL Server Management Studio Express ( right
clicked -and ran as Admin )

Then I attached the database to the server.
I am listed under the Security\Logins <Server>\Miro Public and
Sysadmin are checked for server roles.

Now - comparing two programs vb.net 2008 express and Web Developer 2008
Express

If I go to the database explorer and add a database in vb, i get 2 options:
(I have also tried this by running vb.net as admin as well - right clicking
and run as admin )
Microsoft Access Database File
Microsoft SQL Server Database File

In Web Developer I have way more options:
Microsoft Access Database File
Microsoft ODBC Data Source
Microsoft SQL Server
Microsoft SQL Server Database file
Oracle Database
<other>

(Why different options - I dont understand)

So lets say I want to connect with vb.
Selecting the Microsoft SQL Server Database File
and then in the "Database file name (new or existing),
(local)\SQLExpress\Northwind
Clicking "Test Connection" gives me "This connection cannot be tested
because the specified database file does not exist."

So if I actually click browse and select the path C:\bla\Northwind.mdf
and click "Test Connection" I get a different error:
"Unable to open the physical file "C:\bla\Northwind.mdf". Operating system
error 5: "5(error not found)".
An Attemp to attach an auto-named database for file c:\bla\Northwind.mdf
failed. A database with the same name exists, or specified file cannot be
opend, or it is located on UNC share.

So I assume that error does tell me it does see the mdf file attached to SQL
Express.

What property am I missing?

Im assuming I should be able to refer to my mdf going thru the server
location (local)\SQLExpress\mdfname.mdf


Miro

 
Reply With Quote
 
 
 
 
Miro
Guest
Posts: n/a
 
      14th Feb 2008
I have uninstalled VB.net and re-installed
and now I have 3 servers...

Microsoft Access Database File
Microsot SQL Server Compact 3.5
Microsoft SQL Server Database File

I still cannot connect thru vb.net with (local)\SQLExpress\Northwind

But thru Web Developer,
Since I do have the option Microsoft SQL Server I can use the
(local)\SQLExpress\Northwind
and I can connect.

I still cant figure out why they show different servers and what the
'proper' way to connect is.

Miro

"Miro" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I cant make heads or tails of what I am missing.
> I thought i had the answer to this yesterday but apparently I'm still
> missing something.
>
> First I needed to get a copy of northwind database, so I was able to
> download it from here:
> http://www.microsoft.com/downloads/d...displaylang=en
>
> -Im Running Vista
> I then went into my SQL Server Management Studio Express ( right
> clicked -and ran as Admin )
>
> Then I attached the database to the server.
> I am listed under the Security\Logins <Server>\Miro Public and
> Sysadmin are checked for server roles.
>
> Now - comparing two programs vb.net 2008 express and Web Developer 2008
> Express
>
> If I go to the database explorer and add a database in vb, i get 2
> options:
> (I have also tried this by running vb.net as admin as well - right
> clicking and run as admin )
> Microsoft Access Database File
> Microsoft SQL Server Database File
>
> In Web Developer I have way more options:
> Microsoft Access Database File
> Microsoft ODBC Data Source
> Microsoft SQL Server
> Microsoft SQL Server Database file
> Oracle Database
> <other>
>
> (Why different options - I dont understand)
>
> So lets say I want to connect with vb.
> Selecting the Microsoft SQL Server Database File
> and then in the "Database file name (new or existing),
> (local)\SQLExpress\Northwind
> Clicking "Test Connection" gives me "This connection cannot be tested
> because the specified database file does not exist."
>
> So if I actually click browse and select the path C:\bla\Northwind.mdf
> and click "Test Connection" I get a different error:
> "Unable to open the physical file "C:\bla\Northwind.mdf". Operating
> system error 5: "5(error not found)".
> An Attemp to attach an auto-named database for file c:\bla\Northwind.mdf
> failed. A database with the same name exists, or specified file cannot be
> opend, or it is located on UNC share.
>
> So I assume that error does tell me it does see the mdf file attached to
> SQL Express.
>
> What property am I missing?
>
> Im assuming I should be able to refer to my mdf going thru the server
> location (local)\SQLExpress\mdfname.mdf
>
>
> Miro
>


 
Reply With Quote
 
Miro
Guest
Posts: n/a
 
      14th Feb 2008
I think I found the posts I was looking for:

http://forums.microsoft.com/MSDN/Sho...15612&SiteID=1

Express editions do not let you connect to a (local)\SQLExpress\

They only allow you to connect straight to a local file.

Sorry for all the posts everyone,

Hopefully these posts and this one will help any new newbies out so they
dont go thru the headache like I did.

Miro


"Miro" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I have uninstalled VB.net and re-installed
> and now I have 3 servers...
>
> Microsoft Access Database File
> Microsot SQL Server Compact 3.5
> Microsoft SQL Server Database File
>
> I still cannot connect thru vb.net with (local)\SQLExpress\Northwind
>
> But thru Web Developer,
> Since I do have the option Microsoft SQL Server I can use the
> (local)\SQLExpress\Northwind
> and I can connect.
>
> I still cant figure out why they show different servers and what the
> 'proper' way to connect is.
>
> Miro
>
> "Miro" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I cant make heads or tails of what I am missing.
>> I thought i had the answer to this yesterday but apparently I'm still
>> missing something.
>>
>> First I needed to get a copy of northwind database, so I was able to
>> download it from here:
>> http://www.microsoft.com/downloads/d...displaylang=en
>>
>> -Im Running Vista
>> I then went into my SQL Server Management Studio Express ( right
>> clicked -and ran as Admin )
>>
>> Then I attached the database to the server.
>> I am listed under the Security\Logins <Server>\Miro Public and
>> Sysadmin are checked for server roles.
>>
>> Now - comparing two programs vb.net 2008 express and Web Developer 2008
>> Express
>>
>> If I go to the database explorer and add a database in vb, i get 2
>> options:
>> (I have also tried this by running vb.net as admin as well - right
>> clicking and run as admin )
>> Microsoft Access Database File
>> Microsoft SQL Server Database File
>>
>> In Web Developer I have way more options:
>> Microsoft Access Database File
>> Microsoft ODBC Data Source
>> Microsoft SQL Server
>> Microsoft SQL Server Database file
>> Oracle Database
>> <other>
>>
>> (Why different options - I dont understand)
>>
>> So lets say I want to connect with vb.
>> Selecting the Microsoft SQL Server Database File
>> and then in the "Database file name (new or existing),
>> (local)\SQLExpress\Northwind
>> Clicking "Test Connection" gives me "This connection cannot be tested
>> because the specified database file does not exist."
>>
>> So if I actually click browse and select the path C:\bla\Northwind.mdf
>> and click "Test Connection" I get a different error:
>> "Unable to open the physical file "C:\bla\Northwind.mdf". Operating
>> system error 5: "5(error not found)".
>> An Attemp to attach an auto-named database for file c:\bla\Northwind.mdf
>> failed. A database with the same name exists, or specified file cannot
>> be opend, or it is located on UNC share.
>>
>> So I assume that error does tell me it does see the mdf file attached to
>> SQL Express.
>>
>> What property am I missing?
>>
>> Im assuming I should be able to refer to my mdf going thru the server
>> location (local)\SQLExpress\mdfname.mdf
>>
>>
>> Miro
>>

>


 
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
connecting to remote database without using database links simisantu Webmaster / Programming 0 26th Jul 2007 12:22 AM
connecting to the database =?Utf-8?B?UkJyYWNpbmc=?= Microsoft Access External Data 3 11th May 2005 10:19 PM
Connecting to a database =?Utf-8?B?TXIgQ291cGVy?= Microsoft Outlook Discussion 2 9th Aug 2004 12:43 PM
About connecting to database. Shintaro Microsoft ADO .NET 2 21st Feb 2004 09:27 PM
Connecting in a database Sukist Microsoft Dot NET 2 29th Oct 2003 12:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:12 PM.