ODBCOpen

Opens a connection to the database and returns a numeric handler to be used by other ODBC functions.

Function Group Execution Windows Embedded Thin Client Mobile Access
ODBCOpen ODBC Synchronous Supported Not supported Executed on Server Not supported

Syntax

  ODBCOpen( strDsn, strUser, strPassw, strTable, strFilter, strSort )  
strDsn
The name of the data source.
strUser
The user name.
strPassw
The password.
strTable
The name of the database table
strFilter
The SQL WHERE clause.
strSort
The SQL ORDER BY clause.

Returned value

n On success, returns the handler to identify the database
−1 Invalid parameter
−2 DSN or TableName contain an empty string

Notes

This function does not read or write any data; it simply creates a handle to manipulate the database. You must bind the columns using the ODBCBindCol function, and then you must call the ODBCQuery function to retrieve the first record.

Examples

Tag Name Expression
Tag ODBCOpen( “MyDSNFile”, “Alex”, “”, “Table1″, “Name=’Mayer’”, “Name ASC” )
Tag ODBCOpen( “DSNFileName”, “Robert”, “Robot”, “Table1″, “”, “” )

ODBCOpen