Connection falied to "pubs" database with MSDE 2000

G

Guest

Hi,
I've recently downloaded MSDE and have tried to create a small app to test
the connection. It fails at the Connections Open() method with an error
indicating an invalid server version. I'm running on a standalone PC with
Windows XP and the .NET 2003 Standard edition.

The connection string I used was :-
Dim objConnection As SqlConnection = New
SqlConnection("server=(local);database=C:\SQL Server 2000 Sample
Databases\pubs;user id=sa;password=")

The actual error was:-
ServerVersion <error: an exception of type:System.InvalidOperationException}
occurred> String
 
N

Norman Yuan

The ConnectionString is clearly wrong: the "database" should be a database
name in the SQL Server/MSDE, not a file name. You do not deal with file on
SQL Server MSDE. it should be: "server=(local);database=pubs;user
id=sa;password=".

BWT, it is recommended to never use "sa" account with blank password, even
it is for test.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top