SQLRemoveDSNFromIni

Conformance

Version Introduced: ODBC 1.0

Summary

SQLRemoveDSNFromIni removes a data source from the system information.

Syntax

BOOL SQLRemoveDSNFromIni(
   LPCSTR   lpszDSN);

Arguments

lpszDSN

[Input]
Name of the data source to remove.

Returns

The function returns TRUE if it removes the data source or the data source was not in the ODBC.INI file. It returns FALSE if it fails to remove the data source.

Diagnostics

When SQLRemoveDSNFromIni returns FALSE, an associated *pfErrorCode value may be obtained by calling SQLInstallerError. The following table lists the *pfErrorCode values that can be returned by SQLInstallerError and explains each one in the context of this function.

*pfErrorCode Error Description
ODBC_ERROR_
GENERAL_ERR
General installer error An error occurred for which there was no specific installer error.
ODBC_ERROR_
INVALID_DSN
Invalid DSN The lpszDSN argument was invalid.
ODBC_ERROR_
REQUEST_
FAILED
Request failed The installer could not remove the DSN info from the registry.
ODBC_ERROR_
OUT_OF_MEM
Out of memory The installer could not perform the function because of a lack of memory.

Comments

SQLRemoveDSNFromIni removes the data source name from the [ODBC Data Sources] section of the system information. It also removes the data source specification section from the system information.

This function should only be called from a driver setup library.

Related Functions

For information about See
Adding, modifying, or removing a data source ConfigDSN
Adding, modifying, or removing a data source SQLConfigDataSource
Removing the default data source SQLRemoveDefaultDataSource
Adding a data source name to the system information SQLWriteDSNToIni