/*
* Never update the onlyread from this module.
*/
- if (ODBCINST_INI == fileName)
+ if (stricmp(ODBCINST_INI, fileName) == 0)
{
sprintf(tmp, "%d", comval->onlyread);
SQLWritePrivateProfileString(sectionName, INI_READONLY, tmp,
{
char temp[256];
GLOBAL_VALUES *comval;
+ BOOL inst_position = (stricmp(filename, ODBCINST_INI) == 0);
if (ci)
comval = &(ci->drivers);
if (comval->fetch_max <= 0)
comval->fetch_max = FETCH_MAX;
}
- else if (!ci)
+ else if (inst_position)
comval->fetch_max = FETCH_MAX;
/* Socket Buffersize is stored in driver section */
temp, sizeof(temp), filename);
if (temp[0])
comval->socket_buffersize = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->socket_buffersize = SOCK_BUFFER_SIZE;
/* Debug is stored in the driver section */
temp, sizeof(temp), filename);
if (temp[0])
comval->debug = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->debug = DEFAULT_DEBUG;
/* CommLog is stored in the driver section */
temp, sizeof(temp), filename);
if (temp[0])
comval->commlog = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->commlog = DEFAULT_COMMLOG;
if (!ci)
temp, sizeof(temp), filename);
if (temp[0])
comval->disable_optimizer = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->disable_optimizer = DEFAULT_OPTIMIZER;
/* KSQO is stored in the driver section only */
temp, sizeof(temp), filename);
if (temp[0])
comval->ksqo = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->ksqo = DEFAULT_KSQO;
/* Recognize Unique Index is stored in the driver section only */
temp, sizeof(temp), filename);
if (temp[0])
comval->unique_index = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->unique_index = DEFAULT_UNIQUEINDEX;
temp, sizeof(temp), filename);
if (temp[0])
comval->unknown_sizes = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->unknown_sizes = DEFAULT_UNKNOWNSIZES;
temp, sizeof(temp), filename);
if (temp[0])
comval->lie = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->lie = DEFAULT_LIE;
/* Parse statements */
temp, sizeof(temp), filename);
if (temp[0])
comval->parse = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->parse = DEFAULT_PARSE;
/* SQLCancel calls SQLFreeStmt in Driver Manager */
temp, sizeof(temp), filename);
if (temp[0])
comval->cancel_as_freestmt = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->cancel_as_freestmt = DEFAULT_CANCELASFREESTMT;
/* UseDeclareFetch is stored in the driver section only */
temp, sizeof(temp), filename);
if (temp[0])
comval->use_declarefetch = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->use_declarefetch = DEFAULT_USEDECLAREFETCH;
/* Max Varchar Size */
temp, sizeof(temp), filename);
if (temp[0])
comval->max_varchar_size = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->max_varchar_size = MAX_VARCHAR_SIZE;
/* Max TextField Size */
temp, sizeof(temp), filename);
if (temp[0])
comval->max_longvarchar_size = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->max_longvarchar_size = TEXT_FIELD_SIZE;
/* Text As LongVarchar */
temp, sizeof(temp), filename);
if (temp[0])
comval->text_as_longvarchar = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->text_as_longvarchar = DEFAULT_TEXTASLONGVARCHAR;
/* Unknowns As LongVarchar */
temp, sizeof(temp), filename);
if (temp[0])
comval->unknowns_as_longvarchar = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->unknowns_as_longvarchar = DEFAULT_UNKNOWNSASLONGVARCHAR;
/* Bools As Char */
temp, sizeof(temp), filename);
if (temp[0])
comval->bools_as_char = atoi(temp);
- else if (!ci)
+ else if (inst_position)
comval->bools_as_char = DEFAULT_BOOLSASCHAR;
/* Extra Systable prefixes */
temp, sizeof(temp), filename);
if (strcmp(temp, "@@@"))
strcpy(comval->extra_systable_prefixes, temp);
- else if (!ci)
+ else if (inst_position)
strcpy(comval->extra_systable_prefixes, DEFAULT_EXTRASYSTABLEPREFIXES);
mylog("globals.extra_systable_prefixes = '%s'\n", comval->extra_systable_prefixes);
/* Dont allow override of an override! */
- if (!ci)
+ if (inst_position)
{
/*
* ConnSettings is stored in the driver section and per datasource