﻿# SQLOP\_INIT\_CONN

__

**xcall SQL, SQLOP\_INIT\_CONN, cmdhdr**

The SQLOP\_INIT\_CONN function initializes a connection structure and set of internal resources in preparation for an actual database connection. 

**Parameters**

_cmdhdr_ (ST\_SQL\_CMDHDR), \[in/out\]

The fields of interest to this opcode in the _cmdhdr_ structure (defined in [SQL.DEF](https://bitbucket.org/microsabio/exlib/src/master/909060/sql.def)) are listed below.

| **Field** | **Dir** | **Notes** |
|------|------|------|
| handle | out | new connection handle (needed for all other calls) |
| dbmsconid | in | [DBMS Connector ID](dbmsconnectorid.md) |
| opflags | in | SQLCONF\_TRACE flag activates tracing of ASQL operations in ashlog.log |
| cmdarg1,2 | n/a |  |
| rc | out | return code (0 = ok, see SQLERR\_xxx) |
| rcext | n/s |  |
| info1,2 | n/a |  |
| sqlstate | out | ANSI standard SQL state code |
| reshdl | n/a |  |
| psthdl | n/a |  |




**History**

2012 January, ashmysql connector 1.4.132:  SQLCONF\_TRACE flag added. Note that setting the SQLCONF\_TRACE flag in the _opflags_ field is equivalent to defining an environment variable ASQLTRACE=1.