Knowledge Base

How to Change the Hostname on SQL Server

PSS ID Number: 140301

Article Last Modified on 11/1/2003


The information in this article applies to:


This article was previously published under Q140301

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 and make sure that the UserName has the correct permissions to complete the operation.
       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 = "UserName"
       PWD = "StrongPassword"
       WSID = "My App"
    						
  3. In the new connection string text box, type:

    dsn=Test;uid=UserName;pwd=StrongPassword;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 query words: VFoxWin

Keywords: KB140301
Technology: kbAudDeveloper kbVFP300 kbVFP600 kbVFP600Search kbVFPsearch