sql server vs msde, how to tell

  • Thread starter Thread starter Allen
  • Start date Start date
A

Allen

How do I tell if someone is running sql server or msde?

the reason I need to know this has to do with the connection strings.
When I try to connect to sql server I connect with the name of the
server easily with Data Source=mysqlserver. If I want to connect to
an msde instance I have to do Data Source=(local)\NETSDK. The problem
obvoiusly is that neither works with the other connection string. So
I'm trying to figure out how to tell which it is so I can insert the
(local)\ or not.

any help or advice on alternative solutions to my problem would be
greatly appreciated.

thanks
 
Hi Allen,

Connection strings for both SQL Server and MSDE are exact the same. What you
have right now calls named instances. You may have named in stances with
MSDE or SQL Server and they do NOT distinct MSDE from SQL Server, so you
cannot rely on it. When you install MSDE/SQL Server it asks you if you would
like to use named instances or not. looks like person, who installed MSDE
answered Yes
 
so how do I tell? because the connection string I'm trying to use
with both obviously isn't working. How do I taylor the connection
string to whether or not its a named instance? I need more than
theory, I need to know how to fix this. :/

thanks
 
Hi,

Like for there is nothing to fix, since it is not a bug. If you need to get
list of available SQL Servers, then you could use SQL DMO COM library to get
list of all available servers first and then use their names in your
connection string. Another way, if you have your own login screen, is to
specify server name in login and store it into registry for later use. It
would require to input server name first time only
 
As Val said in his original message though, a better course of action would
be to ensure that the Instance names on your target machines (regardless of
whether they are running SQL Server or MSDE) are identical. That way the
whole connection string thing is a non-issue.

--
Peter Wright
Author of ADO.NET Novice To Pro, from Apress Inc.


_____________________________
 
I built a Class that saves the data the user enters in a log-on form to an
encrypted file in the bin folder.

Then whenever I startup I decrypt the file and re-populate all text boxes
except the password and the user just enters their password and logs-in.

If any of the values change (point to a Test Server) then I re-save them
during
the log-on. The next time they start-up they are pointed to Test (or the
last place they logged in to.)

I build the connection string from these text boxes each time they click my
Log-On button.
Also, it is a global variable.
 
I appreciate all the responses. Boiling it all down though what
everyone is saying is that there isn't a way to tell if its a named
instance or not.

therefore, I solved the problem by trying the name I find in the
registry first, if that fails, I try it with (local)\ in front of it.
If that works then I know to use (local)\ on that machine's instance
from then on.

all solved, thanks for the help.
 
Back
Top