Example: lrd_alloc_connection

In the following example, the lrd_alloc_connection function allocates a connection to an ODBC database after initializing the environment with lrd_init (in the vuser_init section).

lrd_init(&InitInfo, DBTypeVersion);
lrd_open_context(&Ctx1, LRD_DBTYPE_ODBC, 0, 0, 0);
lrd_alloc_connection(&Con1, LRD_DBTYPE_ODBC, Ctx1, 0 /*Unused*/, 0); 
lrd_db_option(Con1, OT_ODBC_TXN_READ_COMMITTED, 0, 0);
lrd_db_option(Con1, OT_ODBC_AUTOCOMMIT, "OFF", 0);
lrd_open_connection(&Con1, LRD_TYPE_ODBC, "", "", "flight32_quadbase", "", Ctx1, 0, 0);
lrd_open_cursor(&Csr1, Con1, 0);