SQLConnect - ODBC Driver for Teradata

ODBC Driver for Teradata® User Guide

Product
ODBC Driver for Teradata
Release Number
16.20
Published
August 2020
Language
English (United States)
Last Update
2020-08-25
dita:mapPath
fxv1527114222338.ditamap
dita:ditavalPath
Audience_PDF_product_legacy_odbc_include.ditaval
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities

SQLConnect assumes that a data source name, username, and password are sufficient to connect to a data source and that all other connection information can be stored on the system. This information is stored in the DSN Settings file in the registry on Windows in the user's odbc.ini file.

Syntax:

SQLRETURN SQLConnect(
SQLHDBC ConnectionHandle,
SQLCHAR * ServerName,
SQLSMALLINT NameLength1,
SQLCHAR * UserName,
SQLSMALLINT NameLength2,
SQLCHAR * Authentication,
SQLSMALLINT NameLength3);

SQLConnect establishes a connection to a driver and a data source. The connection handle references storage of all information about the connection to the data source, including status, transaction state, and error information.

SQLConnect is the simplest connection function. It requires a ServerName (data source name) and accepts an optional UserName and Authentication (typically a password). The UserName and Authentication parameters are passed unmodified to the driver. SQLConnect works well for applications that hard-code a data source name and do not require a UserName or Authentication.

It also works well for applications that want to control their own look and feel or that have no user interface. Such applications can build a list of data sources using SQLDataSources, prompt the user for data source, UserName, and Authentication, and then call SQLConnect.

SQLConnect establishes an authenticated connection using the authentication mechanism selected. SQLConnect returns SQL_ERROR and a new error message if no authentication mechanism can be selected.

If TeraSSO allows fully qualified usernames then the username might contain a domain or realm, for example: george@linedata.