PreviousDTI Programmer's Guide (9.1 revision 1) Next

PvCreateDSN()

Show this topic in Library frames

Creates a new engine data source name (DSN).

Header file: CATALOG.H
Requires: W3DBAV78.DLL or higher version

Syntax

PRESULT PvCreateDSN( 
	BTI_LONG       hConnection, 
	BTI_CHAR_PTR   dsnName, 
	BTI_CHAR_PTR   dsnDesc, 
	BTI_CHAR_PTR   dsnDBQ, 
	BTI_LONG       openMode); 

Arguments

In
hConnection
Connection handle that identifies the server. Connection handles are obtained with the PvConnectServer() function.
In
pdsnName
Name for the new DSN.
In
pdsnDesc
Description for the new DSN.
In
dsnDBQ
Database name to which this DSN will connect. This name must already exist. To create a database name, see PvCreateDatabase().
In
OpenMode
Open mode for the DSN, which is one of the following:
NORMAL_MODE, ACCELERATED_MODE, READONLY_MODE, or EXCLUSIVE_MODE

Return Values

P_OK
The operation was successful.
P_E_INVALID_HANDLE
Invalid connection handle.
P_E_NULL_PTR
Call with NULL pointer
P_E_INVALID_NAME
The specified DSN name is invalid.
P_E_DSN_ALREADY_EXIST
The specified DSN name already exists.
P_E_ACCESS_RIGHT
Insufficient access right for the operation.
P_E_INVALID_OPEN_MODE
The specified open mode is invalid.
P_E_FAIL
Failed to retrieve data path.

Remarks

This function creates engine DSNs only. To create a client DSN, you must use the ODBC API.

The following preconditions must be met:

See Also

PvStart()
PvConnectServer()
PvListDSNs()
PvModifyDSN()
PvGetDSN()
PvGetDSNEx()
PvDeleteDSN()
PvCountDSNs()
PvStop()


Chapter contents
Publication contents

Prev topic: PvCreateDictionary()
Next topic: PvDeleteDSN()