This article was previously published under Q159590
SQL Server can be installed utilizing either Standard, Windows NTIntegrated or Mixed security. The Trusted Connection is available onlyunder Windows NT.
When creating a new DataSource to SQL Server via the ODBC dialog box in the Control Panel of a client machine, there is a radio button check box in step 2 with the label"With Windows NT authentication using the network login ID." Checking this option requests a trustedconnection to SQL Server regardless of the security mode of the server. Forinformation about the SQL Server login security mode and trustedconnections, see the Microsoft SQL Server Administrator's Companion.
Once a DataSource has been created using a Trusted Connection, a connectioncan be created without supplying a user name and password. The user'sWindows NT userid must exist on SQL Server.
To connect from Visual FoxPro via an available DataSource:
Create a DataSource with the Trusted Connection box checked.
In a program or Command window type: x=sqlconnect("datasource name here").
Print the value of x, such as "? x". If x returns a positive number, then a valid connection was established.
To connect from Visual FoxPro via an available connection from a Window NTmachine:
Open up a project in Visual FoxPro.
Choose a valid DataSource with the Trusted connection option checked.
Leave the userid and password text boxes empty.
Visual FoxPro 5.0 and 6 allows you to verify the connection via a command button.