Server_Name (Required)
The Server_Name keyword must be set to a connection string. The connection string identifies the database or DSN to connect to.
Supported By
- SQL Drivers (SQL Server, DB2, and ODBC)
Value
- Connection string
Associated Attribute
DF_FILE_LOGIN(String)
Remarks
The Server_Name keyword must be set to a connection string. The connection string identifies the database or DSN to connect to. The string can contain user information, including password, but that is not required. The string is made up of a number of Keyword=Value pairs separated by semicolons (;).
For information on keeping user information out of the intermediate file, see Commands and Techniques.
Connection String Values
| CONNECTION KEYWORD | DESCRIPTION OF THE VALUE |
|---|---|
| SERVER | Name of a server running SQL Server on the network. The value must be either the name of a server on the network, or the name of a SQL Server Client Network Utility advanced server entry. You can enter (local) as the server name on Windows NT to connect to SQL Server running on the same computer. |
| UID | A valid login account. UID need not be specified when using Windows NT authentication. |
| PWD | The password for the SQL Server login account specified in the UID parameter. PWD need not be specified if the login has a NULL password or when using Windows NT authentication. |
| Trusted_Connection | When YES, instructs the SQL Server driver to use Windows NT Authentication Mode for login validation. The UID and PWD keywords are optional. When NO, instructs the SQL Server driver to use Server username and password for login validation. The UID and PWD keywords must be specified. |
| DATABASE | Name of the default SQL Server database for the connection. If Database is not specified, the default database defined for the login is used. |
| APP | The name of the application (optional). This name will be shown in SQL Server utilities like SQL Server Profiler. If you do not specify an application name, it will be set to “DataFlex”. |
Server specific defined keyword. For a list of configuration keywords and their description, see the manual for your database server.
SQL Server Example
If we want to connect to the table Department owned by dbo in the database Company on server TheCompanyServer using Windows NT authentication, we would create an intermediate file, called dept.int, with the following content:
DRIVER_NAME MSSQLDRV
SERVER_NAME SERVER=TheCompanyServer;Trusted_Connection=yes;DATABASE=Company
DATABASE_NAME Department
SCHEMA_NAME dbo
Connection String Values
| CONNECTION KEYWORD | DESCRIPTION OF THE VALUE |
|---|---|
| DSN | Name or alias name of a DB2 database. |
| UID | A valid DB2 authorization name. |
| PWD | The password corresponding to the authorization name. |
DB2 CLI defined keyword. For a list of configuration keywords and their description, see the DB2 manual.
DB2 Example
For example, if we want to connect to the table Department in the schema CompSchema in the database Company, we would create an intermediate file, called dept.int, with the following content:
DRIVER_NAME DB2_DRV
SERVER_NAME DSN=Company
DATABASE_NAME Department
SCHEMA_NAME CompSchema
Connection String Values
| CONNECTION KEYWORD | DESCRIPTION OF THE VALUE |
|---|---|
| DSN | Name of the data source to connect to. |
| UID | A user id if needed by the data source. |
| PWD | The password corresponding to the user id name. |
Back end specific defined keyword. For a list of configuration keywords and their description, see your database’s manual.
ODBC Example
If we want to connect to the table Department in the data source Company, we would create an intermediate file, called dept.int, with the following content:
DRIVER_NAME ODBC_DRV
SERVER_NAME DSN=Company
DATABASE_NAME Department