1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
/**************************************************
* This code was created by Holger Schurig @ mn-logistik.de.
* Released under LGPL 08.MAR.2001
*
* Additional MaxDB ODBC properties added by
* Martin Kittel <debian @ martin-kittel.de>, 08.05.2005
* -----------------------------------------------
**************************************************/
#include <config.h>
#include <odbcinstext.h>
static const char *aHost[] =
{
"localhost",
NULL
};
static const char *aSqlModes[] =
{
"INTERNAL",
"ORACLE",
"ANSI",
"DB2",
NULL
};
static const char *aIsoLevel[] =
{
"Uncommitted",
"Committed",
"Repeatable",
"Serializable",
NULL
};
int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty )
{
hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) );
hLastProperty = hLastProperty->pNext;
memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) );
hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT;
strncpy( hLastProperty->szName, "ServerNode", INI_MAX_PROPERTY_NAME );
strncpy( hLastProperty->szValue, "localhost", INI_MAX_PROPERTY_VALUE );
hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) );
hLastProperty = hLastProperty->pNext;
memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) );
hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT;
strncpy( hLastProperty->szName, "ServerDB", INI_MAX_PROPERTY_NAME );
strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE );
hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) );
hLastProperty = hLastProperty->pNext;
memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) );
hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX;
hLastProperty->aPromptData = malloc( sizeof( aSqlModes ) );
memcpy( hLastProperty->aPromptData, aSqlModes, sizeof( aSqlModes ) );
strncpy( hLastProperty->szName, "SQLMode", INI_MAX_PROPERTY_NAME );
strncpy( hLastProperty->szValue, "INTERNAL", INI_MAX_PROPERTY_VALUE );
hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) );
hLastProperty = hLastProperty->pNext;
memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) );
hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX;
hLastProperty->aPromptData = malloc( sizeof( aIsoLevel ) );
memcpy( hLastProperty->aPromptData, aIsoLevel, sizeof( aIsoLevel ) );
strncpy( hLastProperty->szName, "IsolationLevel", INI_MAX_PROPERTY_NAME );
strncpy( hLastProperty->szValue, "Committed", INI_MAX_PROPERTY_VALUE );
hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) );
hLastProperty = hLastProperty->pNext;
memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) );
hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_FILENAME;
strncpy( hLastProperty->szName, "TraceFileName", INI_MAX_PROPERTY_NAME );
strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE );
return 1;
}
|