using (local) server on SQL 2K

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create my first SQL Server 2000 app deployment. What I am concerned about is the app won't be able to connect to another machine via MSDE 2000 once installed because I have my own machine name/SQL server name coded into the connection string. I know how to make the string use variables, but how do I find the right variables for a foreign machine, ie., machine name and server name?

When I used SQL server 7 or the MSDE version from 1998, I could set my conn str server property to

server=(local)

and that would work. But I think I was using ODBC, not OLDB for sqlserver, and it wasn't in .NET. I have never been able to connect to my SQL 2000 using the (local) setting. Why not? None of the books I have says much on this except that I should be able to connect via (local). TIA, (e-mail address removed)
 
Hi Patrick,

You should definately consider putting the connection string in a
configuration file so that it can be changed easily. You can localhost or
127.0.0.1.

Hope this helps

--
Chris Taylor
http://dotnetjunkies.com/weblog/chris.taylor


patrick said:
I am trying to create my first SQL Server 2000 app deployment. What I am
concerned about is the app won't be able to connect to another machine via
MSDE 2000 once installed because I have my own machine name/SQL server name
coded into the connection string. I know how to make the string use
variables, but how do I find the right variables for a foreign machine, ie.,
machine name and server name?
When I used SQL server 7 or the MSDE version from 1998, I could set my conn str server property to

server=(local)

and that would work. But I think I was using ODBC, not OLDB for sqlserver,
and it wasn't in .NET. I have never been able to connect to my SQL 2000
using the (local) setting. Why not? None of the books I have says much on
this except that I should be able to connect via (local). TIA,
(e-mail address removed)
 
oSheesh, I never thought of putting my conn string in an external file, thanks a lot Chris! I also haven't tried the localhost or local URL either, I will try those, THANKS!
patrick
 
(local) or "." addressing points to the "default" SQL Server instance. If
you install MSDE or SQL Server Express with a name, it installs as a named
instance and should be addressed using the "\<instanceName>" syntax. In the
future MS will encourage you to use the SQLEXPRESS instance name (which will
be used by default during setup) and to share this common instance with
other applications.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

patrick said:
oSheesh, I never thought of putting my conn string in an external file,
thanks a lot Chris! I also haven't tried the localhost or local URL either,
I will try those, THANKS!
 
I'm in total agreement with Chris - and .NET makes configuration issues very
easy with the .config files
http://www.knowdotnet.com/articles/configfiles.html
As a matter of security though - I'd highly recommend encrypting it. It
sounds like you are uisng this internally exclusively but it's still good
practice and will require a lot less work if you ever need to expose it to
the web or the outside world.


--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
patrick said:
oSheesh, I never thought of putting my conn string in an external file,
thanks a lot Chris! I also haven't tried the localhost or local URL either,
I will try those, THANKS!
 
Thanks guys. I eventually got it working on the other machine. I had to set
the server property to the computer name. I was tring to set to both the
computer name and sql server name.
 
Back
Top