Re: moving EXE from MSDE PC to SQL Server PC



Hi Andrea,

I am almost there. While I got it to work, I am not sure why certain things happen.

I am testing with two XP SP2 computers. One is my development PC (called RICK) with MSDE and Visual Studio, the other is my wife's PC.
I haven't tried named instances as I didn't even know about them when I installed MSDE and I used the defaults. I have a third PC with XP running SQL Server but I am leaving that one out for now until I get this working.


If I code the VB.Net application with any of:
"server=localhost;trusted_connection=true;database=Pubs"
"server=(local);trusted_connection=true;database=Pubs"
"server=RICK;trusted_connection=true;database=Pubs"

it works perfectly from my PC, however, I can not run the application from the other PC (from a shared folder on my PC) unless I use "server=RICK..." line.

I even tried coding for the error, but this doesn't work.

Try
   sqlConn = New SqlConnection("server=localhost;  ....
Catch ex As Exception
   MsgBox(Err.Number, , Err.Description)
   sqlConn = New qlConnection("server=RICK;  ...
End Try

It never gets to the catch part, it just gives the error message "SQL Server does not exist or access denied"

I tried these but they all don't help:
- disabled XP firewall on both PC's
- login with same account that have Admin rights on both PC's

The only thing that works is if I connect with the explicit name "server=RICK"

The problem is when I will move the application to my client, his SQL Server isn't named 'Rick' :)

Any ideas?

Thanks for you help

Richard



Andrea Montanari wrote:
hi Richard,
Richard Fagen wrote:

Hi Andrea,


try "(Local)" for local connections (without quotes)

While this works from my PC (called Rick), it won't work from another PC trying to access MSDE. I get the same message "SQL Server does not exist or access denied".

While I guess I can use the try / catch / end try method to attempt to
connect to the server's name then if I get the error, try to connect
to the MSDE name, I was hoping for something simpler.

What type of connection strings do most people use?
Thanks


just a think... on the remote server, are you using a default instance or a named instance? are the network protocols enabled on the remote server? is there a firewall?
(Local) is the standard way to connect to local default instances, where (Local)\InstanceName is ok for local named instances..
.