Questions

SQL 2005 and XP Mode

Tags:
+
0 Votes
Locked

SQL 2005 and XP Mode

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?
  • +
    0 Votes
    robo_dev

    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.

    +
    0 Votes

    Yes

    puppybreath

    Using that command, it finds the Server.

    +
    0 Votes
    robo_dev

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

    e.g.
    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?

    +
    0 Votes

    No

    puppybreath

    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.

    +
    0 Votes
    Tony Hopkinson

    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.

    +
    0 Votes
    puppybreath

    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.

    +
    0 Votes
    puppybreath

    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.

    +
    0 Votes
    robo_dev

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

    +
    0 Votes
    puppybreath

    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.

    :-)

    +
    0 Votes
    puppybreath

    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.

  • +
    0 Votes
    robo_dev

    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.

    +
    0 Votes

    Yes

    puppybreath

    Using that command, it finds the Server.

    +
    0 Votes
    robo_dev

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

    e.g.
    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?

    +
    0 Votes

    No

    puppybreath

    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.

    +
    0 Votes
    Tony Hopkinson

    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.

    +
    0 Votes
    puppybreath

    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.

    +
    0 Votes
    puppybreath

    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.

    +
    0 Votes
    robo_dev

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

    +
    0 Votes
    puppybreath

    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.

    :-)

    +
    0 Votes
    puppybreath

    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.