HOWTO: Connect to SQL Server Using a Trusted Connection in VFP
ID: Q159590
|
The information in this article applies to:
-
Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 6.0
SUMMARY
SQL Server can be installed utilizing either Standard, Windows NT
Integrated or Mixed security. The Trusted Connection is available only
under Windows NT.
When creating a new DataSource via the ODBC dialog box in the Windows NT
Control Panel, there is a check box in the lower left corner with the
label, "Use Trusted Connection." Checking this option requests a trusted
connection to SQL Server regardless of the security mode of the server. For
information about the SQL Server login security mode and trusted
connections, see the Microsoft SQL Server Administrator's Companion.
Once a DataSource has been created using a Trusted Connection, a connection
can be created without supplying a user name and password. The user's
Windows NT userid must exist on SQL Server.
To connect from Visual FoxPro via an available DataSource on a Windows NT
machine:
- Create a DataSource on the Windows NT machine 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 NT
machine:
- Open up a project in Visual FoxPro.
- Select Connections.
- Select New.
- Choose a valid DataSource with the Trusted connection option checked.
- Leave the userid and password text boxes empty.
- Visual FoxPro 5.0 allows you to verify the connection via a command
button.
- Select Remote Views from the project.
- Select New.
- Use the Connection created by the steps above.
Additional query words:
Keywords : kbinterop kbODBC kbVFp300 kbVFp500 kbVFp600
Version :
Platform :
Issue type : kbhowto
|