How to Change the Hostname on SQL Server

Last reviewed: November 29, 1995
Article ID: Q140301
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SUMMARY

This article shows by example how to change the hostname on a remote connection to SQL Server. The example works assuming that you have first created a data source to SQL Server. This article will not discuss how to create the data source. Being able to change the hostname to the application name allows an administrator of SQL Server to see which users are currently logged on and what applications are running.

MORE INFORMATION

There are two ways to connect to SQL Server in Visual FoxPro through the user interface. You can use one of the available datasources or you can use one of the available connections. To connect to SQL Server, you do not need to use a connection string. You must, however, make the changes documented here:

  1. Create a new connection by selecting connections from the data tab in the Project Manager.

  2. Click the New button. The connection dialog box will appear. Select Connection String. A new connection string text box will appear. You will need to know the following information:

    DSN = The name of the data source. UID = The user login ID. PWD = The user specified password. WSID = The desired "Hostname"

    For example:

    DSN = "Test" UID = "sa" PWD = "password" WSID = "My App"

  3. In the new connection string text box, type:

    dsn=Test;uid=sa;pwd=password;wsid=My App

  4. Save this connection as Connect 1. Use this connection when creating a new remote view. Start a Windows session of ISQL/W. In the query window type:

    sp_who

  5. Press CTRL+E, or click the Execute button. "My App" will display as the hostname.


Additional reference words: 3.00 VFoxWin
KBCategory: kbinterop kbhowto
KBSubcategory: FxinteropOdbc


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.