SQL 2005 and XP Mode

By puppybreath ·
I want to run an application in Win 7 using XP Mode that connects to a SQL 2005 database loaded on the Win 7 host.

I either get an error saying it can't find the server or that it can't connect using Named Pipes (error 40).

I've made sure that the SQL Server is allowing remote connections and that Named Pipes and TCP/IP are both selected. I also started the Browser service.

I turned off the firewall in both environments.

Any idea how to get an app in XP Mode to see SQL Server in Win 7?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Step 1

by robo_dev In reply to SQL 2005 and XP Mode

Find and use the OSQL.EXE utility

At a command prompt type OSQL -L

This should find and list any SQL servers that are listening at port 1434.

Assuming that you can ping the server, you can also port-scan it with NMAP and make sure that port 1434 is visible to the client device.

Collapse -


by puppybreath In reply to Step 1

Using that command, it finds the Server.

Collapse -

That's 99% of the battle

by robo_dev In reply to Yes

If you have the sa account setup, then try doing a connect with OSQL,

osql -U sa -P

note that the above example assumes the sa password is blank.

If that works, then you just need to fix your ODBC settings on your client PC.

note that the OSQL connects via TCP, not named pipes. Can you configure the app to connect via TCP?

Collapse -


by puppybreath In reply to That's 99% of the battle

that fails. I tried adding a DSN on the client. It finds the Server but still fails to connect no matter what settings I try.

I've even tried installing SQL Server on the client to see if it would allow me to register the other Server. It fails from both sides even though it sees the other's server as a network server. So the Host won't register the server on the client and the client won't register the server on the host even though they see each other.

I'm stumped.

Collapse -

What's the security mode ?

by Tony Hopkinson In reply to That's 99% of the battle

If you are on integrated only (the default), there is no sa account.

If you are using integrated then the user running the app needs to be able to access the server.

Collapse -

Security Mode

by puppybreath In reply to What's the security mode ...

I am using integrated for the security mode.

The user and password is the same on the client and the host. The user on the client can access all of the files on the host. Keep in mind that this is XP Mode so it is a virtual box with both "machines" on the same physical box.

This is a stand alone machine so there is only a workgroup defined. There is no domain.

I can't figure out why the two instances of SQL Server can see each other, the user has access to files on both systems, and yet I can't get the client to communicate to the host.

Collapse -


by puppybreath In reply to SQL 2005 and XP Mode

The issue turned out to be a problem resolving the server name. After much testing, I found that I could connect to the SQL Server on the WIN7 host if I used the IP address. From there it was simply a matter of modifying my hosts file and now everything works as I expected.

Collapse -

Well, if it worked the first time you would not have learned as much....

by robo_dev In reply to Update

Of course there are many times when you just want stuff to work, and the lessons can come at a more convenient time.

Collapse -


by puppybreath In reply to Well, if it worked the fi ...

Let me learn my lessons when I'm bored and don't have anything better to do but not when I'm trying to set up an environment for a customer and I'm on a strict time line.


Related Discussions

Related Forums