mirror of https://github.com/postgres/postgres
parent
85f91d0e8e
commit
99d21d5b62
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,762 @@ |
||||
|
||||
/* Module: dlg_specific.c
|
||||
* |
||||
* Description: This module contains any specific code for handling |
||||
* dialog boxes such as driver/datasource options. Both the |
||||
* ConfigDSN() and the SQLDriverConnect() functions use
|
||||
* functions in this module. If you were to add a new option |
||||
* to any dialog box, you would most likely only have to change |
||||
* things in here rather than in 2 separate places as before. |
||||
* |
||||
* Classes: none |
||||
* |
||||
* API functions: none |
||||
* |
||||
* Comments: See "notice.txt" for copyright and license information. |
||||
* |
||||
*/ |
||||
|
||||
#include "dlg_specific.h" |
||||
|
||||
extern GLOBAL_VALUES globals; |
||||
|
||||
void |
||||
SetDlgStuff(HWND hdlg, ConnInfo *ci) |
||||
{ |
||||
/* If driver attribute NOT present, then set the datasource name and description */ |
||||
if (ci->driver[0] == '\0') { |
||||
SetDlgItemText(hdlg, IDC_DSNAME, ci->dsn); |
||||
SetDlgItemText(hdlg, IDC_DESC, ci->desc); |
||||
} |
||||
|
||||
SetDlgItemText(hdlg, IDC_DATABASE, ci->database); |
||||
SetDlgItemText(hdlg, IDC_SERVER, ci->server); |
||||
SetDlgItemText(hdlg, IDC_USER, ci->username); |
||||
SetDlgItemText(hdlg, IDC_PASSWORD, ci->password); |
||||
SetDlgItemText(hdlg, IDC_PORT, ci->port); |
||||
} |
||||
|
||||
void
|
||||
GetDlgStuff(HWND hdlg, ConnInfo *ci) |
||||
{ |
||||
GetDlgItemText(hdlg, IDC_DESC, ci->desc, sizeof(ci->desc)); |
||||
|
||||
GetDlgItemText(hdlg, IDC_DATABASE, ci->database, sizeof(ci->database)); |
||||
GetDlgItemText(hdlg, IDC_SERVER, ci->server, sizeof(ci->server)); |
||||
GetDlgItemText(hdlg, IDC_USER, ci->username, sizeof(ci->username)); |
||||
GetDlgItemText(hdlg, IDC_PASSWORD, ci->password, sizeof(ci->password)); |
||||
GetDlgItemText(hdlg, IDC_PORT, ci->port, sizeof(ci->port)); |
||||
} |
||||
|
||||
|
||||
|
||||
int CALLBACK driver_optionsProc(HWND hdlg, |
||||
WORD wMsg, |
||||
WPARAM wParam, |
||||
LPARAM lParam) |
||||
{ |
||||
switch (wMsg) { |
||||
case WM_INITDIALOG: |
||||
|
||||
CheckDlgButton(hdlg, DRV_COMMLOG, globals.commlog); |
||||
CheckDlgButton(hdlg, DRV_OPTIMIZER, globals.disable_optimizer); |
||||
CheckDlgButton(hdlg, DRV_UNIQUEINDEX, globals.unique_index); |
||||
CheckDlgButton(hdlg, DRV_READONLY, globals.readonly); |
||||
CheckDlgButton(hdlg, DRV_USEDECLAREFETCH, globals.use_declarefetch); |
||||
|
||||
/* Unknown (Default) Data Type sizes */ |
||||
switch(globals.unknown_sizes) { |
||||
case UNKNOWNS_AS_DONTKNOW: |
||||
CheckDlgButton(hdlg, DRV_UNKNOWN_DONTKNOW, 1); |
||||
break; |
||||
case UNKNOWNS_AS_LONGEST: |
||||
CheckDlgButton(hdlg, DRV_UNKNOWN_LONGEST, 1); |
||||
break; |
||||
case UNKNOWNS_AS_MAX: |
||||
default: |
||||
CheckDlgButton(hdlg, DRV_UNKNOWN_MAX, 1); |
||||
break; |
||||
} |
||||
|
||||
CheckDlgButton(hdlg, DRV_TEXT_LONGVARCHAR, globals.text_as_longvarchar); |
||||
CheckDlgButton(hdlg, DRV_UNKNOWNS_LONGVARCHAR, globals.unknowns_as_longvarchar); |
||||
CheckDlgButton(hdlg, DRV_BOOLS_CHAR, globals.bools_as_char); |
||||
|
||||
SetDlgItemInt(hdlg, DRV_CACHE_SIZE, globals.fetch_max, FALSE); |
||||
SetDlgItemInt(hdlg, DRV_VARCHAR_SIZE, globals.max_varchar_size, FALSE); |
||||
SetDlgItemInt(hdlg, DRV_LONGVARCHAR_SIZE, globals.max_longvarchar_size, TRUE); |
||||
|
||||
SetDlgItemText(hdlg, DRV_EXTRASYSTABLEPREFIXES, globals.extra_systable_prefixes); |
||||
|
||||
/* Driver Connection Settings */ |
||||
SetDlgItemText(hdlg, DRV_CONNSETTINGS, globals.conn_settings); |
||||
|
||||
break;
|
||||
|
||||
case WM_COMMAND: |
||||
switch (GET_WM_COMMAND_ID(wParam, lParam)) { |
||||
case IDOK: |
||||
|
||||
globals.commlog = IsDlgButtonChecked(hdlg, DRV_COMMLOG); |
||||
globals.disable_optimizer = IsDlgButtonChecked(hdlg, DRV_OPTIMIZER); |
||||
globals.unique_index = IsDlgButtonChecked(hdlg, DRV_UNIQUEINDEX); |
||||
globals.readonly = IsDlgButtonChecked(hdlg, DRV_READONLY); |
||||
globals.use_declarefetch = IsDlgButtonChecked(hdlg, DRV_USEDECLAREFETCH); |
||||
|
||||
/* Unknown (Default) Data Type sizes */ |
||||
if (IsDlgButtonChecked(hdlg, DRV_UNKNOWN_MAX)) |
||||
globals.unknown_sizes = UNKNOWNS_AS_MAX; |
||||
else if (IsDlgButtonChecked(hdlg, DRV_UNKNOWN_DONTKNOW)) |
||||
globals.unknown_sizes = UNKNOWNS_AS_DONTKNOW; |
||||
else if (IsDlgButtonChecked(hdlg, DRV_UNKNOWN_LONGEST)) |
||||
globals.unknown_sizes = UNKNOWNS_AS_LONGEST; |
||||
else |
||||
globals.unknown_sizes = UNKNOWNS_AS_MAX; |
||||
|
||||
globals.text_as_longvarchar = IsDlgButtonChecked(hdlg, DRV_TEXT_LONGVARCHAR); |
||||
globals.unknowns_as_longvarchar = IsDlgButtonChecked(hdlg, DRV_UNKNOWNS_LONGVARCHAR); |
||||
globals.bools_as_char = IsDlgButtonChecked(hdlg, DRV_BOOLS_CHAR); |
||||
|
||||
globals.fetch_max = GetDlgItemInt(hdlg, DRV_CACHE_SIZE, NULL, FALSE); |
||||
globals.max_varchar_size = GetDlgItemInt(hdlg, DRV_VARCHAR_SIZE, NULL, FALSE); |
||||
globals.max_longvarchar_size= GetDlgItemInt(hdlg, DRV_LONGVARCHAR_SIZE, NULL, TRUE); // allows for SQL_NO_TOTAL
|
||||
|
||||
GetDlgItemText(hdlg, DRV_EXTRASYSTABLEPREFIXES, globals.extra_systable_prefixes, sizeof(globals.extra_systable_prefixes)); |
||||
|
||||
/* Driver Connection Settings */ |
||||
GetDlgItemText(hdlg, DRV_CONNSETTINGS, globals.conn_settings, sizeof(globals.conn_settings)); |
||||
|
||||
updateGlobals(); |
||||
|
||||
// fall through
|
||||
|
||||
case IDCANCEL: |
||||
EndDialog(hdlg, GET_WM_COMMAND_ID(wParam, lParam) == IDOK); |
||||
return TRUE; |
||||
|
||||
case IDDEFAULTS: |
||||
CheckDlgButton(hdlg, DRV_COMMLOG, DEFAULT_COMMLOG); |
||||
CheckDlgButton(hdlg, DRV_OPTIMIZER, DEFAULT_OPTIMIZER); |
||||
CheckDlgButton(hdlg, DRV_UNIQUEINDEX, DEFAULT_UNIQUEINDEX); |
||||
CheckDlgButton(hdlg, DRV_READONLY, DEFAULT_READONLY); |
||||
CheckDlgButton(hdlg, DRV_USEDECLAREFETCH, DEFAULT_USEDECLAREFETCH); |
||||
|
||||
/* Unknown Sizes */ |
||||
CheckDlgButton(hdlg, DRV_UNKNOWN_DONTKNOW, 0); |
||||
CheckDlgButton(hdlg, DRV_UNKNOWN_LONGEST, 0); |
||||
CheckDlgButton(hdlg, DRV_UNKNOWN_MAX, 0); |
||||
switch(DEFAULT_UNKNOWNSIZES) { |
||||
case UNKNOWNS_AS_DONTKNOW: |
||||
CheckDlgButton(hdlg, DRV_UNKNOWN_DONTKNOW, 1); |
||||
break; |
||||
case UNKNOWNS_AS_LONGEST: |
||||
CheckDlgButton(hdlg, DRV_UNKNOWN_LONGEST, 1); |
||||
break; |
||||
case UNKNOWNS_AS_MAX: |
||||
CheckDlgButton(hdlg, DRV_UNKNOWN_MAX, 1); |
||||
break; |
||||
} |
||||
|
||||
CheckDlgButton(hdlg, DRV_TEXT_LONGVARCHAR, DEFAULT_TEXTASLONGVARCHAR); |
||||
CheckDlgButton(hdlg, DRV_UNKNOWNS_LONGVARCHAR, DEFAULT_UNKNOWNSASLONGVARCHAR); |
||||
CheckDlgButton(hdlg, DRV_BOOLS_CHAR, DEFAULT_BOOLSASCHAR); |
||||
|
||||
SetDlgItemInt(hdlg, DRV_CACHE_SIZE, FETCH_MAX, FALSE); |
||||
SetDlgItemInt(hdlg, DRV_VARCHAR_SIZE, MAX_VARCHAR_SIZE, FALSE); |
||||
SetDlgItemInt(hdlg, DRV_LONGVARCHAR_SIZE, TEXT_FIELD_SIZE, TRUE); |
||||
|
||||
SetDlgItemText(hdlg, DRV_EXTRASYSTABLEPREFIXES, DEFAULT_EXTRASYSTABLEPREFIXES); |
||||
|
||||
/* Driver Connection Settings */ |
||||
SetDlgItemText(hdlg, DRV_CONNSETTINGS, ""); |
||||
|
||||
break; |
||||
} |
||||
|
||||
} |
||||
|
||||
return FALSE; |
||||
} |
||||
|
||||
int CALLBACK ds_optionsProc(HWND hdlg, |
||||
WORD wMsg, |
||||
WPARAM wParam, |
||||
LPARAM lParam) |
||||
{ |
||||
ConnInfo *ci; |
||||
char buf[128]; |
||||
// int unknown_sizes;
|
||||
|
||||
switch (wMsg) { |
||||
case WM_INITDIALOG: |
||||
ci = (ConnInfo *) lParam;
|
||||
SetWindowLong(hdlg, DWL_USER, lParam); // save for OK
|
||||
|
||||
/* Change window caption */ |
||||
if (ci->driver[0]) |
||||
SetWindowText(hdlg, "Advanced Options (Connection)"); |
||||
else { |
||||
sprintf(buf, "Advanced Options (%s)", ci->dsn); |
||||
SetWindowText(hdlg, buf); |
||||
} |
||||
|
||||
/* Readonly */ |
||||
CheckDlgButton(hdlg, DS_READONLY, atoi(ci->readonly)); |
||||
|
||||
/* Protocol */ |
||||
if (strncmp(ci->protocol, PG62, strlen(PG62)) == 0) |
||||
CheckDlgButton(hdlg, DS_PG62, 1); |
||||
else |
||||
CheckDlgButton(hdlg, DS_PG62, 0); |
||||
|
||||
/* Unknown Data Type sizes -- currently only needed in Driver options.
|
||||
switch (atoi(ci->unknown_sizes)) { |
||||
case UNKNOWNS_AS_DONTKNOW: |
||||
CheckDlgButton(hdlg, DS_UNKNOWN_DONTKNOW, 1); |
||||
break; |
||||
case UNKNOWNS_AS_LONGEST: |
||||
CheckDlgButton(hdlg, DS_UNKNOWN_LONGEST, 1); |
||||
break; |
||||
case UNKNOWNS_AS_MAX: |
||||
default: |
||||
CheckDlgButton(hdlg, DS_UNKNOWN_MAX, 1); |
||||
break; |
||||
} |
||||
*/ |
||||
|
||||
CheckDlgButton(hdlg, DS_SHOWOIDCOLUMN, atoi(ci->show_oid_column)); |
||||
CheckDlgButton(hdlg, DS_FAKEOIDINDEX, atoi(ci->fake_oid_index)); |
||||
CheckDlgButton(hdlg, DS_SHOWSYSTEMTABLES, atoi(ci->show_system_tables)); |
||||
|
||||
EnableWindow(GetDlgItem(hdlg, DS_FAKEOIDINDEX), atoi(ci->show_oid_column)); |
||||
|
||||
/* Datasource Connection Settings */ |
||||
SetDlgItemText(hdlg, DS_CONNSETTINGS, ci->conn_settings); |
||||
break;
|
||||
|
||||
|
||||
case WM_COMMAND: |
||||
switch (GET_WM_COMMAND_ID(wParam, lParam)) { |
||||
case DS_SHOWOIDCOLUMN: |
||||
mylog("WM_COMMAND: DS_SHOWOIDCOLUMN\n"); |
||||
EnableWindow(GetDlgItem(hdlg, DS_FAKEOIDINDEX), IsDlgButtonChecked(hdlg, DS_SHOWOIDCOLUMN)); |
||||
return TRUE; |
||||
|
||||
|
||||
case IDOK:
|
||||
|
||||
ci = (ConnInfo *)GetWindowLong(hdlg, DWL_USER); |
||||
mylog("IDOK: got ci = %u\n", ci); |
||||
|
||||
/* Readonly */ |
||||
sprintf(ci->readonly, "%d", IsDlgButtonChecked(hdlg, DS_READONLY)); |
||||
|
||||
/* Protocol */ |
||||
if ( IsDlgButtonChecked(hdlg, DS_PG62)) |
||||
strcpy(ci->protocol, PG62); |
||||
else
|
||||
ci->protocol[0] = '\0'; |
||||
|
||||
|
||||
/* Unknown Data Type sizes -- currently only needed in Driver options.
|
||||
if (IsDlgButtonChecked(hdlg, DS_UNKNOWN_MAX)) |
||||
unknown_sizes = UNKNOWNS_AS_MAX; |
||||
else if (IsDlgButtonChecked(hdlg, DS_UNKNOWN_DONTKNOW)) |
||||
unknown_sizes = UNKNOWNS_AS_DONTKNOW; |
||||
else if (IsDlgButtonChecked(hdlg, DS_UNKNOWN_LONGEST)) |
||||
unknown_sizes = UNKNOWNS_AS_LONGEST; |
||||
else |
||||
unknown_sizes = UNKNOWNS_AS_MAX; |
||||
|
||||
sprintf(ci->unknown_sizes, "%d", unknown_sizes); |
||||
*/ |
||||
|
||||
sprintf(ci->show_system_tables, "%d", IsDlgButtonChecked(hdlg, DS_SHOWSYSTEMTABLES)); |
||||
|
||||
/* OID Options*/ |
||||
sprintf(ci->fake_oid_index, "%d", IsDlgButtonChecked(hdlg, DS_FAKEOIDINDEX)); |
||||
sprintf(ci->show_oid_column, "%d", IsDlgButtonChecked(hdlg, DS_SHOWOIDCOLUMN)); |
||||
|
||||
/* Datasource Connection Settings */ |
||||
GetDlgItemText(hdlg, DS_CONNSETTINGS, ci->conn_settings, sizeof(ci->conn_settings)); |
||||
|
||||
|
||||
// fall through
|
||||
|
||||
case IDCANCEL: |
||||
EndDialog(hdlg, GET_WM_COMMAND_ID(wParam, lParam) == IDOK); |
||||
return TRUE; |
||||
} |
||||
} |
||||
|
||||
return FALSE; |
||||
} |
||||
|
||||
void |
||||
makeConnectString(char *connect_string, ConnInfo *ci) |
||||
{ |
||||
char got_dsn = (ci->dsn[0] != '\0'); |
||||
|
||||
sprintf(connect_string, "%s=%s;DATABASE=%s;SERVER=%s;PORT=%s;UID=%s;READONLY=%s;PWD=%s;PROTOCOL=%s;FAKEOIDINDEX=%s;SHOWOIDCOLUMN=%s;SHOWSYSTEMTABLES=%s;CONNSETTINGS=%s",
|
||||
got_dsn ? "DSN" : "DRIVER",
|
||||
got_dsn ? ci->dsn : ci->driver, |
||||
ci->database, |
||||
ci->server, |
||||
ci->port, |
||||
ci->username, |
||||
ci->readonly, |
||||
ci->password, |
||||
ci->protocol, |
||||
// ci->unknown_sizes, -- currently only needed in Driver options.
|
||||
ci->fake_oid_index, |
||||
ci->show_oid_column, |
||||
ci->show_system_tables, |
||||
ci->conn_settings); |
||||
} |
||||
|
||||
void |
||||
copyAttributes(ConnInfo *ci, char *attribute, char *value) |
||||
{ |
||||
|
||||
if(stricmp(attribute, "DSN") == 0) |
||||
strcpy(ci->dsn, value); |
||||
|
||||
else if(stricmp(attribute, "driver") == 0) |
||||
strcpy(ci->driver, value); |
||||
|
||||
else if(stricmp(attribute, INI_DATABASE) == 0) |
||||
strcpy(ci->database, value); |
||||
|
||||
else if(stricmp(attribute, INI_SERVER) == 0 || stricmp(attribute, "server") == 0) |
||||
strcpy(ci->server, value); |
||||
|
||||
else if(stricmp(attribute, INI_USER) == 0 || stricmp(attribute, "uid") == 0) |
||||
strcpy(ci->username, value); |
||||
|
||||
else if(stricmp(attribute, INI_PASSWORD) == 0 || stricmp(attribute, "pwd") == 0) |
||||
strcpy(ci->password, value); |
||||
|
||||
else if(stricmp(attribute, INI_PORT) == 0) |
||||
strcpy(ci->port, value); |
||||
|
||||
else if (stricmp(attribute, INI_READONLY) == 0) |
||||
strcpy(ci->readonly, value); |
||||
|
||||
else if (stricmp(attribute, INI_PROTOCOL) == 0) |
||||
strcpy(ci->protocol, value); |
||||
|
||||
/*
|
||||
else if (stricmp(attribute, INI_UNKNOWNSIZES) == 0) |
||||
strcpy(ci->unknown_sizes, value); |
||||
*/ |
||||
else if (stricmp(attribute, INI_SHOWOIDCOLUMN) == 0) |
||||
strcpy(ci->show_oid_column, value); |
||||
|
||||
else if (stricmp(attribute, INI_FAKEOIDINDEX) == 0) |
||||
strcpy(ci->fake_oid_index, value); |
||||
|
||||
else if (stricmp(attribute, INI_SHOWSYSTEMTABLES) == 0) |
||||
strcpy(ci->show_system_tables, value); |
||||
|
||||
else if (stricmp(attribute, INI_CONNSETTINGS) == 0) |
||||
strcpy(ci->conn_settings, value); |
||||
|
||||
|
||||
mylog("copyAttributes: DSN='%s',server='%s',dbase='%s',user='%s',passwd='%s',port='%s',readonly='%s',protocol='%s', conn_settings='%s')\n",
|
||||
ci->dsn,
|
||||
ci->server, |
||||
ci->database, |
||||
ci->username, |
||||
ci->password, |
||||
ci->port, |
||||
ci->readonly, |
||||
ci->protocol, |
||||
// ci->unknown_sizes,
|
||||
ci->conn_settings); |
||||
|
||||
} |
||||
|
||||
void |
||||
getDSNdefaults(ConnInfo *ci) |
||||
{ |
||||
if (ci->port[0] == '\0') |
||||
strcpy(ci->port, DEFAULT_PORT); |
||||
|
||||
if (ci->readonly[0] == '\0') |
||||
sprintf(ci->readonly, "%d", globals.readonly); |
||||
|
||||
/* -- currently only needed in Driver options.
|
||||
if (ci->unknown_sizes[0] == '\0') |
||||
sprintf(ci->unknown_sizes, "%d", globals.unknown_sizes); |
||||
*/ |
||||
if (ci->fake_oid_index[0] == '\0') |
||||
sprintf(ci->fake_oid_index, "%d", DEFAULT_FAKEOIDINDEX); |
||||
|
||||
if (ci->show_oid_column[0] == '\0') |
||||
sprintf(ci->show_oid_column, "%d", DEFAULT_SHOWOIDCOLUMN); |
||||
|
||||
if (ci->show_system_tables[0] == '\0') |
||||
sprintf(ci->show_system_tables, "%d", DEFAULT_SHOWSYSTEMTABLES); |
||||
|
||||
} |
||||
|
||||
|
||||
void
|
||||
getDSNinfo(ConnInfo *ci, char overwrite) |
||||
{ |
||||
char *DSN = ci->dsn; |
||||
|
||||
// If a driver keyword was present, then dont use a DSN and return.
|
||||
// If DSN is null and no driver, then use the default datasource.
|
||||
if ( DSN[0] == '\0') { |
||||
if ( ci->driver[0] != '\0') |
||||
return; |
||||
else |
||||
strcpy(DSN, INI_DSN); |
||||
} |
||||
|
||||
// Proceed with getting info for the given DSN.
|
||||
|
||||
if ( ci->desc[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_KDESC, "", ci->desc, sizeof(ci->desc), ODBC_INI); |
||||
|
||||
if ( ci->server[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_SERVER, "", ci->server, sizeof(ci->server), ODBC_INI); |
||||
|
||||
if ( ci->database[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_DATABASE, "", ci->database, sizeof(ci->database), ODBC_INI); |
||||
|
||||
if ( ci->username[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_USER, "", ci->username, sizeof(ci->username), ODBC_INI); |
||||
|
||||
if ( ci->password[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_PASSWORD, "", ci->password, sizeof(ci->password), ODBC_INI); |
||||
|
||||
if ( ci->port[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_PORT, "", ci->port, sizeof(ci->port), ODBC_INI); |
||||
|
||||
if ( ci->readonly[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_READONLY, "", ci->readonly, sizeof(ci->readonly), ODBC_INI); |
||||
|
||||
/* -- currently only needed in Driver options.
|
||||
if ( ci->unknown_sizes[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_UNKNOWNSIZES, "", ci->unknown_sizes, sizeof(ci->unknown_sizes), ODBC_INI); |
||||
*/ |
||||
if ( ci->show_oid_column[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_SHOWOIDCOLUMN, "", ci->show_oid_column, sizeof(ci->show_oid_column), ODBC_INI); |
||||
|
||||
if ( ci->fake_oid_index[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_FAKEOIDINDEX, "", ci->fake_oid_index, sizeof(ci->fake_oid_index), ODBC_INI); |
||||
|
||||
if ( ci->show_system_tables[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_SHOWSYSTEMTABLES, "", ci->show_system_tables, sizeof(ci->show_system_tables), ODBC_INI); |
||||
|
||||
if ( ci->protocol[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_PROTOCOL, "", ci->protocol, sizeof(ci->protocol), ODBC_INI); |
||||
|
||||
if ( ci->conn_settings[0] == '\0' || overwrite) |
||||
SQLGetPrivateProfileString(DSN, INI_CONNSETTINGS, "", ci->conn_settings, sizeof(ci->conn_settings), ODBC_INI); |
||||
|
||||
qlog("DSN info: DSN='%s',server='%s',port='%s',dbase='%s',user='%s',passwd='%s'\n",
|
||||
DSN,
|
||||
ci->server, |
||||
ci->port, |
||||
ci->database, |
||||
ci->username, |
||||
ci->password); |
||||
qlog(" readonly='%s',protocol='%s',showoid='%s',fakeoidindex='%s',showsystable='%s'\n", |
||||
ci->readonly, |
||||
ci->protocol, |
||||
ci->show_oid_column, |
||||
ci->fake_oid_index, |
||||
// ci->unknown_sizes,
|
||||
ci->show_system_tables); |
||||
qlog(" conn_settings='%s'\n", |
||||
ci->conn_settings); |
||||
} |
||||
|
||||
|
||||
/* This is for datasource based options only */ |
||||
void |
||||
writeDSNinfo(ConnInfo *ci) |
||||
{ |
||||
char *DSN = ci->dsn; |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_KDESC, |
||||
ci->desc, |
||||
ODBC_INI); |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_DATABASE, |
||||
ci->database, |
||||
ODBC_INI); |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_SERVER, |
||||
ci->server, |
||||
ODBC_INI); |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_PORT, |
||||
ci->port, |
||||
ODBC_INI); |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_USER, |
||||
ci->username, |
||||
ODBC_INI); |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_PASSWORD, |
||||
ci->password, |
||||
ODBC_INI); |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_READONLY, |
||||
ci->readonly, |
||||
ODBC_INI); |
||||
|
||||
/* -- currently only needed in Driver options.
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_UNKNOWNSIZES, |
||||
ci->unknown_sizes, |
||||
ODBC_INI); |
||||
*/ |
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_SHOWOIDCOLUMN, |
||||
ci->show_oid_column, |
||||
ODBC_INI); |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_FAKEOIDINDEX, |
||||
ci->fake_oid_index, |
||||
ODBC_INI); |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_SHOWSYSTEMTABLES, |
||||
ci->show_system_tables, |
||||
ODBC_INI); |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_PROTOCOL, |
||||
ci->protocol, |
||||
ODBC_INI); |
||||
|
||||
SQLWritePrivateProfileString(DSN, |
||||
INI_CONNSETTINGS, |
||||
ci->conn_settings, |
||||
ODBC_INI); |
||||
} |
||||
|
||||
|
||||
/* This function reads the ODBCINST.INI portion of
|
||||
the registry and gets any driver defaults. |
||||
*/ |
||||
void getGlobalDefaults(void) |
||||
{ |
||||
char temp[128]; |
||||
|
||||
|
||||
// Fetch Count is stored in driver section
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_FETCH, "", |
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] ) { |
||||
globals.fetch_max = atoi(temp); |
||||
/* sanity check if using cursors */ |
||||
if (globals.fetch_max <= 0) |
||||
globals.fetch_max = FETCH_MAX; |
||||
} |
||||
|
||||
else |
||||
globals.fetch_max = FETCH_MAX; |
||||
|
||||
|
||||
// Socket Buffersize is stored in driver section
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_SOCKET, "", |
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] )
|
||||
globals.socket_buffersize = atoi(temp); |
||||
else |
||||
globals.socket_buffersize = SOCK_BUFFER_SIZE; |
||||
|
||||
|
||||
// Debug is stored in the driver section
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_DEBUG, "0",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
globals.debug = atoi(temp); |
||||
|
||||
|
||||
// CommLog is stored in the driver section
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_COMMLOG, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0')
|
||||
globals.commlog = DEFAULT_COMMLOG; |
||||
else |
||||
globals.commlog = atoi(temp); |
||||
|
||||
|
||||
// Optimizer is stored in the driver section only
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_OPTIMIZER, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0')
|
||||
globals.disable_optimizer = DEFAULT_OPTIMIZER; |
||||
else |
||||
globals.disable_optimizer = atoi(temp); |
||||
|
||||
|
||||
// Recognize Unique Index is stored in the driver section only
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_UNIQUEINDEX, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0')
|
||||
globals.unique_index = DEFAULT_UNIQUEINDEX; |
||||
else |
||||
globals.unique_index = atoi(temp); |
||||
|
||||
|
||||
// Unknown Sizes is stored in the driver section AND per datasource
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_UNKNOWNSIZES, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0') |
||||
globals.unknown_sizes = DEFAULT_UNKNOWNSIZES; |
||||
else |
||||
globals.unknown_sizes = atoi(temp); |
||||
|
||||
|
||||
// Readonly is stored in the driver section AND per datasource
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_READONLY, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0')
|
||||
globals.readonly = DEFAULT_READONLY; |
||||
else |
||||
globals.readonly = atoi(temp); |
||||
|
||||
|
||||
// UseDeclareFetch is stored in the driver section only
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_USEDECLAREFETCH, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0')
|
||||
globals.use_declarefetch = DEFAULT_USEDECLAREFETCH; |
||||
else |
||||
globals.use_declarefetch = atoi(temp); |
||||
|
||||
|
||||
// Max Varchar Size
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_MAXVARCHARSIZE, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0')
|
||||
globals.max_varchar_size = MAX_VARCHAR_SIZE; |
||||
else |
||||
globals.max_varchar_size = atoi(temp); |
||||
|
||||
// Max TextField Size
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_MAXLONGVARCHARSIZE, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0')
|
||||
globals.max_longvarchar_size = TEXT_FIELD_SIZE; |
||||
else |
||||
globals.max_longvarchar_size = atoi(temp); |
||||
|
||||
// Text As LongVarchar
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_TEXTASLONGVARCHAR, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0')
|
||||
globals.text_as_longvarchar = DEFAULT_TEXTASLONGVARCHAR; |
||||
else |
||||
globals.text_as_longvarchar = atoi(temp); |
||||
|
||||
// Unknowns As LongVarchar
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_UNKNOWNSASLONGVARCHAR, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0')
|
||||
globals.unknowns_as_longvarchar = DEFAULT_UNKNOWNSASLONGVARCHAR; |
||||
else |
||||
globals.unknowns_as_longvarchar = atoi(temp); |
||||
|
||||
// Bools As Char
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_BOOLSASCHAR, "",
|
||||
temp, sizeof(temp), ODBCINST_INI); |
||||
if ( temp[0] == '\0')
|
||||
globals.bools_as_char = DEFAULT_BOOLSASCHAR; |
||||
else |
||||
globals.bools_as_char = atoi(temp); |
||||
|
||||
|
||||
// Extra System Table prefixes
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_EXTRASYSTABLEPREFIXES, "@@@",
|
||||
globals.extra_systable_prefixes, sizeof(globals.extra_systable_prefixes), ODBCINST_INI); |
||||
if ( ! strcmp(globals.extra_systable_prefixes, "@@@")) { |
||||
strcpy(globals.extra_systable_prefixes, DEFAULT_EXTRASYSTABLEPREFIXES); |
||||
} |
||||
mylog("globals.extra_systable_prefixes = '%s'\n", globals.extra_systable_prefixes); |
||||
|
||||
|
||||
// ConnSettings is stored in the driver section and per datasource for override
|
||||
SQLGetPrivateProfileString(DBMS_NAME, INI_CONNSETTINGS, "",
|
||||
globals.conn_settings, sizeof(globals.conn_settings), ODBCINST_INI); |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
/* This function writes any global parameters (that can be manipulated)
|
||||
to the ODBCINST.INI portion of the registry
|
||||
*/ |
||||
void updateGlobals(void) |
||||
{ |
||||
char tmp[128]; |
||||
|
||||
sprintf(tmp, "%d", globals.fetch_max); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_FETCH, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.commlog); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_COMMLOG, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.disable_optimizer); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_OPTIMIZER, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.unique_index); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_UNIQUEINDEX, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.readonly); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_READONLY, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.use_declarefetch); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_USEDECLAREFETCH, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.unknown_sizes); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_UNKNOWNSIZES, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.text_as_longvarchar); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_TEXTASLONGVARCHAR, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.unknowns_as_longvarchar); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_UNKNOWNSASLONGVARCHAR, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.bools_as_char); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_BOOLSASCHAR, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.max_varchar_size); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_MAXVARCHARSIZE, tmp, ODBCINST_INI); |
||||
|
||||
sprintf(tmp, "%d", globals.max_longvarchar_size); |
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_MAXLONGVARCHARSIZE, tmp, ODBCINST_INI); |
||||
|
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_EXTRASYSTABLEPREFIXES, globals.extra_systable_prefixes, ODBCINST_INI); |
||||
|
||||
SQLWritePrivateProfileString(DBMS_NAME, |
||||
INI_CONNSETTINGS, globals.conn_settings, ODBCINST_INI); |
||||
} |
||||
@ -0,0 +1,103 @@ |
||||
|
||||
/* File: dlg_specific.h
|
||||
* |
||||
* Description: See "dlg_specific.c" |
||||
* |
||||
* Comments: See "notice.txt" for copyright and license information. |
||||
* |
||||
*/ |
||||
|
||||
#ifndef __DLG_SPECIFIC_H__ |
||||
#define __DLG_SPECIFIC_H__ |
||||
|
||||
#include "psqlodbc.h" |
||||
#include "connection.h" |
||||
#include <windows.h> |
||||
#include <windowsx.h> |
||||
#include <odbcinst.h> |
||||
#include "resource.h" |
||||
|
||||
/* Unknown data type sizes */ |
||||
#define UNKNOWNS_AS_MAX 0 |
||||
#define UNKNOWNS_AS_DONTKNOW 1 |
||||
#define UNKNOWNS_AS_LONGEST 2 |
||||
|
||||
/* INI File Stuff */ |
||||
#define ODBC_INI "ODBC.INI" /* ODBC initialization file */ |
||||
#define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation file */ |
||||
|
||||
#define INI_DSN DBMS_NAME /* Name of default Datasource in ini file (not used?) */ |
||||
#define INI_KDESC "Description" /* Data source description */ |
||||
#define INI_SERVER "Servername" /* Name of Server running the Postgres service */ |
||||
#define INI_PORT "Port" /* Port on which the Postmaster is listening */ |
||||
#define INI_DATABASE "Database" /* Database Name */ |
||||
#define INI_USER "Username" /* Default User Name */ |
||||
#define INI_PASSWORD "Password" /* Default Password */ |
||||
#define INI_DEBUG "Debug" /* Debug flag */ |
||||
#define INI_FETCH "Fetch" /* Fetch Max Count */ |
||||
#define INI_SOCKET "Socket" /* Socket buffer size */ |
||||
#define INI_READONLY "ReadOnly" /* Database is read only */ |
||||
#define INI_COMMLOG "CommLog" /* Communication to backend logging */ |
||||
#define INI_PROTOCOL "Protocol" /* What protocol (6.2) */ |
||||
#define INI_OPTIMIZER "Optimizer" /* Use backend genetic optimizer */ |
||||
#define INI_CONNSETTINGS "ConnSettings" /* Anything to send to backend on successful connection */ |
||||
#define INI_UNIQUEINDEX "UniqueIndex" /* Recognize unique indexes */ |
||||
#define INI_UNKNOWNSIZES "UnknownSizes" /* How to handle unknown result set sizes */ |
||||
|
||||
#define INI_USEDECLAREFETCH "UseDeclareFetch" /* Use Declare/Fetch cursors */ |
||||
|
||||
/* More ini stuff */ |
||||
#define INI_TEXTASLONGVARCHAR "TextAsLongVarchar" |
||||
#define INI_UNKNOWNSASLONGVARCHAR "UnknownsAsLongVarchar" |
||||
#define INI_BOOLSASCHAR "BoolsAsChar" |
||||
#define INI_MAXVARCHARSIZE "MaxVarcharSize" |
||||
#define INI_MAXLONGVARCHARSIZE "MaxLongVarcharSize" |
||||
|
||||
#define INI_FAKEOIDINDEX "FakeOidIndex" |
||||
#define INI_SHOWOIDCOLUMN "ShowOidColumn" |
||||
#define INI_SHOWSYSTEMTABLES "ShowSystemTables" |
||||
#define INI_EXTRASYSTABLEPREFIXES "ExtraSysTablePrefixes" |
||||
|
||||
/* Connection Defaults */ |
||||
#define DEFAULT_PORT "5432" |
||||
#define DEFAULT_READONLY 1 |
||||
#define DEFAULT_USEDECLAREFETCH 1 |
||||
#define DEFAULT_TEXTASLONGVARCHAR 1 |
||||
#define DEFAULT_UNKNOWNSASLONGVARCHAR 0 |
||||
#define DEFAULT_BOOLSASCHAR 1 |
||||
#define DEFAULT_OPTIMIZER 1 // disable
|
||||
#define DEFAULT_UNIQUEINDEX 0 // dont recognize
|
||||
#define DEFAULT_COMMLOG 0 // dont log
|
||||
#define DEFAULT_UNKNOWNSIZES UNKNOWNS_AS_MAX |
||||
|
||||
|
||||
#define DEFAULT_FAKEOIDINDEX 0 |
||||
#define DEFAULT_SHOWOIDCOLUMN 0 |
||||
#define DEFAULT_SHOWSYSTEMTABLES 0 // dont show system tables
|
||||
|
||||
#define DEFAULT_EXTRASYSTABLEPREFIXES "dd_;" |
||||
|
||||
/* prototypes */ |
||||
void updateGlobals(void); |
||||
void getGlobalDefaults(void); |
||||
|
||||
void SetDlgStuff(HWND hdlg, ConnInfo *ci); |
||||
void GetDlgStuff(HWND hdlg, ConnInfo *ci); |
||||
|
||||
int CALLBACK driver_optionsProc(HWND hdlg, |
||||
WORD wMsg, |
||||
WPARAM wParam, |
||||
LPARAM lParam); |
||||
int CALLBACK ds_optionsProc(HWND hdlg, |
||||
WORD wMsg, |
||||
WPARAM wParam, |
||||
LPARAM lParam); |
||||
|
||||
void makeConnectString(char *connect_string, ConnInfo *ci); |
||||
void copyAttributes(ConnInfo *ci, char *attribute, char *value); |
||||
void getDSNdefaults(ConnInfo *ci); |
||||
|
||||
void getDSNinfo(ConnInfo *ci, char overwrite); |
||||
void writeDSNinfo(ConnInfo *ci); |
||||
|
||||
#endif |
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,35 +1,35 @@ |
||||
|
||||
/******************************************************************** |
||||
|
||||
PSQLODBC.DLL - A library to talk to the PostgreSQL DBMS using ODBC. |
||||
|
||||
|
||||
Copyright (C) 1998; Insight Distribution Systems |
||||
|
||||
The code contained in this library is based on code written by |
||||
Christian Czezatke and Dan McGuirk, (C) 1996. |
||||
|
||||
|
||||
This library is free software; you can redistribute it and/or modify |
||||
it under the terms of the GNU Library General Public License as |
||||
published by the Free Software Foundation; either version 2 of the |
||||
License, or (at your option) any later version. |
||||
|
||||
This library is distributed in the hope that it will be useful, but |
||||
WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
Library General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU Library General Public |
||||
License along with this library (see "license.txt"); if not, write to |
||||
the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA |
||||
02139, USA. |
||||
|
||||
|
||||
How to contact the author: |
||||
|
||||
email: byronn@insightdist.com (Byron Nikolaidis) |
||||
|
||||
|
||||
***********************************************************************/ |
||||
|
||||
|
||||
/******************************************************************** |
||||
|
||||
PSQLODBC.DLL - A library to talk to the PostgreSQL DBMS using ODBC. |
||||
|
||||
|
||||
Copyright (C) 1998; Insight Distribution Systems |
||||
|
||||
The code contained in this library is based on code written by |
||||
Christian Czezatke and Dan McGuirk, (C) 1996. |
||||
|
||||
|
||||
This library is free software; you can redistribute it and/or modify |
||||
it under the terms of the GNU Library General Public License as |
||||
published by the Free Software Foundation; either version 2 of the |
||||
License, or (at your option) any later version. |
||||
|
||||
This library is distributed in the hope that it will be useful, but |
||||
WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
Library General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU Library General Public |
||||
License along with this library (see "license.txt"); if not, write to |
||||
the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA |
||||
02139, USA. |
||||
|
||||
|
||||
How to contact the author: |
||||
|
||||
email: byronn@insightdist.com (Byron Nikolaidis) |
||||
|
||||
|
||||
***********************************************************************/ |
||||
|
||||
|
||||
@ -1,205 +1,262 @@ |
||||
//Microsoft Developer Studio generated resource script. |
||||
// |
||||
#include "resource.h" |
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS |
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// Generated from the TEXTINCLUDE 2 resource. |
||||
// |
||||
#include "afxres.h" |
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
#undef APSTUDIO_READONLY_SYMBOLS |
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// English (U.S.) resources |
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) |
||||
#ifdef _WIN32 |
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US |
||||
#pragma code_page(1252) |
||||
#endif //_WIN32 |
||||
|
||||
#ifdef APSTUDIO_INVOKED |
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// TEXTINCLUDE |
||||
// |
||||
|
||||
1 TEXTINCLUDE DISCARDABLE |
||||
BEGIN |
||||
"resource.h\0" |
||||
END |
||||
|
||||
2 TEXTINCLUDE DISCARDABLE |
||||
BEGIN |
||||
"#include ""afxres.h""\r\n" |
||||
"\0" |
||||
END |
||||
|
||||
3 TEXTINCLUDE DISCARDABLE |
||||
BEGIN |
||||
"\r\n" |
||||
"\0" |
||||
END |
||||
|
||||
#endif // APSTUDIO_INVOKED |
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// Dialog |
||||
// |
||||
|
||||
DRIVERCONNDIALOG DIALOG DISCARDABLE 0, 0, 269, 133 |
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
||||
CAPTION "PostgreSQL Connection" |
||||
FONT 8, "MS Sans Serif" |
||||
BEGIN |
||||
RTEXT "&Database:",IDC_STATIC,16,25,37,8 |
||||
EDITTEXT DATABASE_EDIT,55,25,72,12,ES_AUTOHSCROLL |
||||
RTEXT "&Server:",IDC_STATIC,26,40,27,8 |
||||
EDITTEXT SERVER_EDIT,55,40,72,12,ES_AUTOHSCROLL |
||||
RTEXT "&Port:",IDC_STATIC,150,40,20,8 |
||||
EDITTEXT PORT_EDIT,172,40,72,12,ES_AUTOHSCROLL |
||||
RTEXT "&User Name:",IDC_STATIC,16,56,37,8 |
||||
EDITTEXT USERNAME_EDIT,55,56,72,12,ES_AUTOHSCROLL |
||||
RTEXT "Pass&word:",IDC_STATIC,137,56,33,8 |
||||
EDITTEXT PASSWORD_EDIT,172,56,72,12,ES_PASSWORD | ES_AUTOHSCROLL |
||||
GROUPBOX "Options:",IDC_STATIC,25,71,200,25 |
||||
CONTROL "&ReadOnly:",READONLY_EDIT,"Button",BS_AUTOCHECKBOX | |
||||
BS_LEFTTEXT | BS_RIGHT | WS_GROUP | WS_TABSTOP,45,80,45, |
||||
14 |
||||
CONTROL "&CommLog (Global):",COMMLOG_EDIT,"Button", |
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_RIGHT | WS_TABSTOP, |
||||
100,80,75,14 |
||||
CONTROL "6.2",PG62_EDIT,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | |
||||
BS_RIGHT | WS_TABSTOP,185,80,25,14 |
||||
DEFPUSHBUTTON "OK",IDOK,84,108,40,14,WS_GROUP |
||||
PUSHBUTTON "Cancel",IDCANCEL,146,108,40,14 |
||||
CTEXT "Please supply any missing information needed to connect.", |
||||
IDC_STATIC,40,7,188,11 |
||||
END |
||||
|
||||
CONFIGDSN DIALOG DISCARDABLE 65, 43, 292, 151 |
||||
STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | |
||||
WS_SYSMENU |
||||
CAPTION "PostgreSQL Driver Setup" |
||||
FONT 8, "MS Sans Serif" |
||||
BEGIN |
||||
RTEXT "&Data Source:",IDC_DSNAMETEXT,5,30,50,12,NOT WS_GROUP |
||||
EDITTEXT IDC_DSNAME,57,30,72,12,ES_AUTOHSCROLL | WS_GROUP |
||||
RTEXT "Des&cription:",IDC_STATIC,135,30,39,12,NOT WS_GROUP |
||||
EDITTEXT IDC_DESC,175,30,108,12,ES_AUTOHSCROLL |
||||
RTEXT "Data&base:",IDC_STATIC,17,45,38,12,NOT WS_GROUP |
||||
EDITTEXT IDC_DATABASE,57,45,72,12,ES_AUTOHSCROLL |
||||
RTEXT "&Server:",IDC_STATIC,27,60,29,12,NOT WS_GROUP |
||||
EDITTEXT IDC_SERVER,57,60,72,12,ES_AUTOHSCROLL |
||||
RTEXT "&Port:",IDC_STATIC,153,60,22,12 |
||||
EDITTEXT IDC_PORT,175,60,37,12,ES_AUTOHSCROLL |
||||
RTEXT "&User Name:",IDC_STATIC,17,75,39,12 |
||||
EDITTEXT IDC_USER,57,75,72,12,ES_AUTOHSCROLL |
||||
RTEXT "Pass&word:",IDC_STATIC,141,75,34,12 |
||||
EDITTEXT IDC_PASSWORD,175,75,72,12,ES_PASSWORD | ES_AUTOHSCROLL |
||||
GROUPBOX "Options:",IDC_STATIC,35,92,205,25 |
||||
CONTROL "&ReadOnly:",IDC_READONLY,"Button",BS_AUTOCHECKBOX | |
||||
BS_LEFTTEXT | BS_RIGHT | WS_GROUP | WS_TABSTOP,50,100,45, |
||||
14 |
||||
CONTROL "&CommLog (Global):",IDC_COMMLOG,"Button", |
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_RIGHT | WS_TABSTOP, |
||||
105,100,75,14 |
||||
CONTROL "6.2",IDC_PG62,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | |
||||
BS_RIGHT | WS_TABSTOP,195,100,25,14 |
||||
DEFPUSHBUTTON "OK",IDOK,85,129,40,14,WS_GROUP |
||||
PUSHBUTTON "Cancel",IDCANCEL,145,129,40,14 |
||||
CTEXT "Change data source name, description, or options. Then choose OK.", |
||||
IDC_STATIC,44,5,180,17 |
||||
END |
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// DESIGNINFO |
||||
// |
||||
|
||||
#ifdef APSTUDIO_INVOKED |
||||
GUIDELINES DESIGNINFO DISCARDABLE |
||||
BEGIN |
||||
DRIVERCONNDIALOG, DIALOG |
||||
BEGIN |
||||
RIGHTMARGIN, 268 |
||||
END |
||||
END |
||||
#endif // APSTUDIO_INVOKED |
||||
|
||||
|
||||
#ifndef _MAC |
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// Version |
||||
// |
||||
|
||||
VS_VERSION_INFO VERSIONINFO |
||||
FILEVERSION 6,30,0,0 |
||||
PRODUCTVERSION 6,30,0,0 |
||||
FILEFLAGSMASK 0x3L |
||||
#ifdef _DEBUG |
||||
FILEFLAGS 0x1L |
||||
#else |
||||
FILEFLAGS 0x0L |
||||
#endif |
||||
FILEOS 0x4L |
||||
FILETYPE 0x2L |
||||
FILESUBTYPE 0x0L |
||||
BEGIN |
||||
BLOCK "StringFileInfo" |
||||
BEGIN |
||||
BLOCK "040904e4" |
||||
BEGIN |
||||
VALUE "Comments", "PostgreSQL ODBC driver for Windows 95\0" |
||||
VALUE "CompanyName", "Insight Distribution Systems\0" |
||||
VALUE "FileDescription", "PostgreSQL Driver\0" |
||||
VALUE "FileVersion", " 6.30.0000\0" |
||||
VALUE "InternalName", "psqlodbc\0" |
||||
VALUE "LegalTrademarks", "ODBC(TM) is a trademark of Microsoft Corporation. Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation.\0" |
||||
VALUE "OriginalFilename", "psqlodbc.dll\0" |
||||
VALUE "ProductName", "Microsoft Open Database Connectivity\0" |
||||
VALUE "ProductVersion", " 6.30.0000\0" |
||||
END |
||||
END |
||||
BLOCK "VarFileInfo" |
||||
BEGIN |
||||
VALUE "Translation", 0x409, 1252 |
||||
END |
||||
END |
||||
|
||||
#endif // !_MAC |
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// String Table |
||||
// |
||||
|
||||
STRINGTABLE DISCARDABLE |
||||
BEGIN |
||||
IDS_BADDSN "Invalid DSN entry, please recheck." |
||||
IDS_MSGTITLE "Invalid DSN" |
||||
END |
||||
|
||||
#endif // English (U.S.) resources |
||||
///////////////////////////////////////////////////////////////////////////// |
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED |
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// Generated from the TEXTINCLUDE 3 resource. |
||||
// |
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
#endif // not APSTUDIO_INVOKED |
||||
|
||||
//Microsoft Developer Studio generated resource script. |
||||
// |
||||
#include "resource.h" |
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS |
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// Generated from the TEXTINCLUDE 2 resource. |
||||
// |
||||
#include "afxres.h" |
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
#undef APSTUDIO_READONLY_SYMBOLS |
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// English (U.S.) resources |
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) |
||||
#ifdef _WIN32 |
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US |
||||
#pragma code_page(1252) |
||||
#endif //_WIN32 |
||||
|
||||
#ifdef APSTUDIO_INVOKED |
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// TEXTINCLUDE |
||||
// |
||||
|
||||
1 TEXTINCLUDE DISCARDABLE |
||||
BEGIN |
||||
"resource.h\0" |
||||
END |
||||
|
||||
2 TEXTINCLUDE DISCARDABLE |
||||
BEGIN |
||||
"#include ""afxres.h""\r\n" |
||||
"\0" |
||||
END |
||||
|
||||
3 TEXTINCLUDE DISCARDABLE |
||||
BEGIN |
||||
"\r\n" |
||||
"\0" |
||||
END |
||||
|
||||
#endif // APSTUDIO_INVOKED |
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// Dialog |
||||
// |
||||
|
||||
DLG_CONFIG DIALOG DISCARDABLE 65, 43, 292, 116 |
||||
STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | |
||||
WS_SYSMENU |
||||
CAPTION "PostgreSQL Driver Setup" |
||||
FONT 8, "MS Sans Serif" |
||||
BEGIN |
||||
RTEXT "&Data Source:",IDC_DSNAMETEXT,5,10,50,12,NOT WS_GROUP |
||||
EDITTEXT IDC_DSNAME,57,10,72,12,ES_AUTOHSCROLL | WS_GROUP |
||||
RTEXT "Des&cription:",IDC_DESCTEXT,135,10,39,12,NOT WS_GROUP |
||||
EDITTEXT IDC_DESC,175,10,108,12,ES_AUTOHSCROLL |
||||
RTEXT "Data&base:",IDC_STATIC,17,25,38,12,NOT WS_GROUP |
||||
EDITTEXT IDC_DATABASE,57,25,72,12,ES_AUTOHSCROLL |
||||
RTEXT "&Server:",IDC_STATIC,27,40,29,12,NOT WS_GROUP |
||||
EDITTEXT IDC_SERVER,57,40,72,12,ES_AUTOHSCROLL |
||||
RTEXT "&Port:",IDC_STATIC,153,40,22,12 |
||||
EDITTEXT IDC_PORT,175,40,37,12,ES_AUTOHSCROLL |
||||
RTEXT "&User Name:",IDC_STATIC,17,55,39,12 |
||||
EDITTEXT IDC_USER,57,55,72,12,ES_AUTOHSCROLL |
||||
RTEXT "Pass&word:",IDC_STATIC,141,55,34,12 |
||||
EDITTEXT IDC_PASSWORD,175,55,72,12,ES_PASSWORD | ES_AUTOHSCROLL |
||||
DEFPUSHBUTTON "OK",IDOK,25,90,40,14,WS_GROUP |
||||
PUSHBUTTON "Cancel",IDCANCEL,80,90,40,14 |
||||
GROUPBOX "Options (Advanced):",IDC_STATIC,140,74,140,35,BS_CENTER |
||||
PUSHBUTTON "Driver",IDC_DRIVER,160,90,50,14 |
||||
PUSHBUTTON "DataSource",IDC_DATASOURCE,220,90,50,14 |
||||
CTEXT "Please supply any missing information needed to connect.", |
||||
DRV_MSG_LABEL,36,5,220,15 |
||||
END |
||||
|
||||
DLG_OPTIONS_DRV DIALOG DISCARDABLE 0, 0, 287, 226 |
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
||||
CAPTION "Advanced Options (Driver)" |
||||
FONT 8, "MS Sans Serif" |
||||
BEGIN |
||||
CONTROL "Disable Genetic &Optimizer",DRV_OPTIMIZER,"Button", |
||||
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,15,10,97,10 |
||||
CONTROL "Comm&Log (C:\\psqlodbc.log)",DRV_COMMLOG,"Button", |
||||
BS_AUTOCHECKBOX | WS_TABSTOP,140,10,113,10 |
||||
CONTROL "Recognize Unique &Indexes",DRV_UNIQUEINDEX,"Button", |
||||
BS_AUTOCHECKBOX | WS_TABSTOP,15,25,101,10 |
||||
CONTROL "&ReadOnly (Default)",DRV_READONLY,"Button", |
||||
BS_AUTOCHECKBOX | WS_TABSTOP,140,25,80,10 |
||||
CONTROL "&Use Declare/Fetch",DRV_USEDECLAREFETCH,"Button", |
||||
BS_AUTOCHECKBOX | WS_TABSTOP,15,40,80,10 |
||||
GROUPBOX "Unknown Sizes",IDC_STATIC,10,55,175,25 |
||||
CONTROL "Maximum",DRV_UNKNOWN_MAX,"Button",BS_AUTORADIOBUTTON | |
||||
WS_GROUP | WS_TABSTOP,15,65,45,10 |
||||
CONTROL "Don't Know",DRV_UNKNOWN_DONTKNOW,"Button", |
||||
BS_AUTORADIOBUTTON | WS_TABSTOP,70,65,53,10 |
||||
CONTROL "Longest",DRV_UNKNOWN_LONGEST,"Button", |
||||
BS_AUTORADIOBUTTON | WS_TABSTOP,130,65,50,10 |
||||
GROUPBOX "Data Type Options",IDC_STATIC,10,85,270,25 |
||||
CONTROL "Text as LongVarChar",DRV_TEXT_LONGVARCHAR,"Button", |
||||
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,15,95,80,10 |
||||
CONTROL "Unknowns as LongVarChar",DRV_UNKNOWNS_LONGVARCHAR, |
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,105,95,100,10 |
||||
CONTROL "Bools as Char",DRV_BOOLS_CHAR,"Button",BS_AUTOCHECKBOX | |
||||
WS_TABSTOP,215,95,60,10 |
||||
LTEXT "&Cache Size:",IDC_STATIC,10,120,40,10 |
||||
EDITTEXT DRV_CACHE_SIZE,50,120,35,12,ES_AUTOHSCROLL |
||||
LTEXT "Max &Varchar:",IDC_STATIC,90,120,45,10 |
||||
EDITTEXT DRV_VARCHAR_SIZE,135,120,35,12,ES_AUTOHSCROLL |
||||
LTEXT "Max Lon&gVarChar:",IDC_STATIC,180,120,60,10 |
||||
EDITTEXT DRV_LONGVARCHAR_SIZE,240,120,35,12,ES_AUTOHSCROLL |
||||
LTEXT "SysTable &Prefixes:",IDC_STATIC,15,135,35,20 |
||||
EDITTEXT DRV_EXTRASYSTABLEPREFIXES,50,140,75,12,ES_AUTOHSCROLL |
||||
RTEXT "Connect &Settings:",IDC_STATIC,10,165,35,25 |
||||
EDITTEXT DRV_CONNSETTINGS,50,160,225,35,ES_MULTILINE | |
||||
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN |
||||
DEFPUSHBUTTON "OK",IDOK,45,205,50,14,WS_GROUP |
||||
PUSHBUTTON "Cancel",IDCANCEL,115,205,50,14 |
||||
PUSHBUTTON "Defaults",IDDEFAULTS,185,205,50,15 |
||||
END |
||||
|
||||
DLG_OPTIONS_DS DIALOG DISCARDABLE 0, 0, 267, 170 |
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
||||
CAPTION "Advanced Options (DataSource)" |
||||
FONT 8, "MS Sans Serif" |
||||
BEGIN |
||||
CONTROL "&ReadOnly",DS_READONLY,"Button",BS_AUTOCHECKBOX | |
||||
WS_GROUP | WS_TABSTOP,25,10,45,15 |
||||
CONTROL "&6.2 Protocol",DS_PG62,"Button",BS_AUTOCHECKBOX | |
||||
WS_TABSTOP,130,10,60,14 |
||||
CONTROL "Show System &Tables",DS_SHOWSYSTEMTABLES,"Button", |
||||
BS_AUTOCHECKBOX | WS_TABSTOP,25,30,85,10 |
||||
GROUPBOX "OID Options",IDC_STATIC,15,50,180,25 |
||||
CONTROL "Show &Column",DS_SHOWOIDCOLUMN,"Button",BS_AUTOCHECKBOX | |
||||
WS_GROUP | WS_TABSTOP,25,60,59,10 |
||||
CONTROL "Fake &Index",DS_FAKEOIDINDEX,"Button",BS_AUTOCHECKBOX | |
||||
WS_GROUP | WS_TABSTOP,115,60,51,10 |
||||
RTEXT "Connect &Settings:",IDC_STATIC,10,90,35,25 |
||||
EDITTEXT DS_CONNSETTINGS,50,85,200,35,ES_MULTILINE | |
||||
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN |
||||
DEFPUSHBUTTON "OK",IDOK,65,130,50,14,WS_GROUP |
||||
PUSHBUTTON "Cancel",IDCANCEL,140,130,50,14 |
||||
GROUPBOX "Unknown Sizes",IDC_STATIC,10,145,175,25,NOT WS_VISIBLE |
||||
CONTROL "Maximum",DS_UNKNOWN_MAX,"Button",BS_AUTORADIOBUTTON | |
||||
NOT WS_VISIBLE | WS_GROUP | WS_TABSTOP,15,155,45,10 |
||||
CONTROL "Don't Know",DS_UNKNOWN_DONTKNOW,"Button", |
||||
BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,70,155, |
||||
53,10 |
||||
CONTROL "Longest",DS_UNKNOWN_LONGEST,"Button",BS_AUTORADIOBUTTON | |
||||
NOT WS_VISIBLE | WS_TABSTOP,130,155,50,10 |
||||
END |
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// DESIGNINFO |
||||
// |
||||
|
||||
#ifdef APSTUDIO_INVOKED |
||||
GUIDELINES DESIGNINFO DISCARDABLE |
||||
BEGIN |
||||
DLG_CONFIG, DIALOG |
||||
BEGIN |
||||
BOTTOMMARGIN, 115 |
||||
END |
||||
|
||||
DLG_OPTIONS_DRV, DIALOG |
||||
BEGIN |
||||
LEFTMARGIN, 7 |
||||
RIGHTMARGIN, 280 |
||||
TOPMARGIN, 7 |
||||
BOTTOMMARGIN, 219 |
||||
END |
||||
|
||||
DLG_OPTIONS_DS, DIALOG |
||||
BEGIN |
||||
LEFTMARGIN, 5 |
||||
RIGHTMARGIN, 260 |
||||
VERTGUIDE, 55 |
||||
TOPMARGIN, 7 |
||||
BOTTOMMARGIN, 163 |
||||
END |
||||
END |
||||
#endif // APSTUDIO_INVOKED |
||||
|
||||
|
||||
#ifndef _MAC |
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// Version |
||||
// |
||||
|
||||
VS_VERSION_INFO VERSIONINFO |
||||
FILEVERSION 6,30,2,44 |
||||
PRODUCTVERSION 6,30,2,44 |
||||
FILEFLAGSMASK 0x3L |
||||
#ifdef _DEBUG |
||||
FILEFLAGS 0x1L |
||||
#else |
||||
FILEFLAGS 0x0L |
||||
#endif |
||||
FILEOS 0x4L |
||||
FILETYPE 0x2L |
||||
FILESUBTYPE 0x0L |
||||
BEGIN |
||||
BLOCK "StringFileInfo" |
||||
BEGIN |
||||
BLOCK "040904e4" |
||||
BEGIN |
||||
VALUE "Comments", "PostgreSQL ODBC driver for Windows 95\0" |
||||
VALUE "CompanyName", "Insight Distribution Systems\0" |
||||
VALUE "FileDescription", "PostgreSQL Driver\0" |
||||
VALUE "FileVersion", " 6.30.0244\0" |
||||
VALUE "InternalName", "psqlodbc\0" |
||||
VALUE "LegalTrademarks", "ODBC(TM) is a trademark of Microsoft Corporation. Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation.\0" |
||||
VALUE "OriginalFilename", "psqlodbc.dll\0" |
||||
VALUE "ProductName", "Microsoft Open Database Connectivity\0" |
||||
VALUE "ProductVersion", " 6.30.0244\0" |
||||
END |
||||
END |
||||
BLOCK "VarFileInfo" |
||||
BEGIN |
||||
VALUE "Translation", 0x409, 1252 |
||||
END |
||||
END |
||||
|
||||
#endif // !_MAC |
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// String Table |
||||
// |
||||
|
||||
STRINGTABLE DISCARDABLE |
||||
BEGIN |
||||
IDS_BADDSN "Invalid DSN entry, please recheck." |
||||
IDS_MSGTITLE "Invalid DSN" |
||||
END |
||||
|
||||
#endif // English (U.S.) resources |
||||
///////////////////////////////////////////////////////////////////////////// |
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED |
||||
///////////////////////////////////////////////////////////////////////////// |
||||
// |
||||
// Generated from the TEXTINCLUDE 3 resource. |
||||
// |
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// |
||||
#endif // not APSTUDIO_INVOKED |
||||
|
||||
|
||||
@ -0,0 +1,72 @@ |
||||
|
||||
Readme for psqlodbc.dll 4/15/98 |
||||
------------------------------------------------------------------------------- |
||||
Latest binary and source updates available at http://www.insightdist.com/psqlodbc |
||||
|
||||
|
||||
I. Building the Driver from the source code |
||||
|
||||
This section describes how to build the PostgreSQL ODBC Driver (psqlodbc.dll). |
||||
Microsoft Visual C++ version 4.0 or higher is required. There is no manually |
||||
constructed Makefile. The visual C++ environment automatically generates one |
||||
during the build process. Thus, the project binary files (".ncb", ".mdp", ".aps") |
||||
nor the makefile are really distributed as part of the source code release |
||||
(although they are probably in there anyway). |
||||
|
||||
1. Create a new project workspace with the type DLL. For the name, type in the |
||||
name "psqlodbc". |
||||
|
||||
2. The above step creates the directory "psqlodbc" under the |
||||
"\<Visual C++ top level directory>\projects" path to hold the source files. |
||||
(example, \msdev\projects\psqlodbc). Now, either unzip the source code release |
||||
into this directory or just copy all the files into this directory. |
||||
|
||||
3. Insert all of the source files (*.c, *.h, *.rc, *.def) into the Visual project |
||||
using the "Insert files into project" command. You may have to do 2 inserts -- |
||||
the first to get the 'c' and header files, and the second to get the def file. |
||||
Don't forget the .def file since it is an important part of the release. |
||||
You can even insert ".txt" files into the projects -- they will do nothing. |
||||
|
||||
4. Add the "wsock32.lib" library to the end of the list of libraries for linking |
||||
using the Build settings menu. |
||||
|
||||
5. Select the type of build on the toolbar (i.e., Release or Debug). This is |
||||
one of the useful features of the visual c++ environment in that you can |
||||
browse the entire project if you build the "Debug" release. For release |
||||
purposes however, select "Release" build. |
||||
|
||||
6. Build the dll by selecting Build from the build menu. |
||||
|
||||
7. When complete, the "psqlodbc.dll" file is under the "Release" subdirectory. |
||||
(i.e., "\msdev\projects\psqlodbc\release\psqlodbc.dll") |
||||
|
||||
|
||||
|
||||
II. Using Large Objects for handling LongVarBinary (OLE Objects in Access) |
||||
|
||||
Large objects are mapped to LONGVARBINARY in the driver to allow storing things like |
||||
OLE objects in Microsoft Access. Multiple SQLPutData and SQLGetData calls are usually |
||||
used to send and retrieve these objects. The driver creates a new large object and simply |
||||
inserts its 'identifier' into the respective table. However, since Postgres uses an 'Oid' |
||||
to identify a Large Object, it is necessary to create a new Postgres type to be able |
||||
to discriminate between an ordinary Oid and a Large Object Oid. Until this new type |
||||
becomes an official part of Postgres, it must be added into the desired database and |
||||
looked up for each connection. The type used in the driver is simply called "lo" and |
||||
here is the command used to create it: |
||||
|
||||
create type lo (internallength=4,externallength=10,input=int4in,output=int4out, |
||||
default='',passedbyvalue); |
||||
|
||||
Once this is done, simply use the new 'lo' type to define columns in that database. Note |
||||
that this must be done for each database you want to use large objects in with the driver. |
||||
When the driver sees an 'lo' type, it will handle it as LONGVARBINARY. |
||||
|
||||
Another important note is that this new type is lacking in functionality. It will not |
||||
cleanup after itself on updates and deletes, thus leaving orphans around and using up |
||||
extra disk space. And currently, Postgres does not support the vacuuming of large |
||||
objects. Hopefully in the future, a real large object data type will be available. |
||||
|
||||
But for now, it sure is fun to stick a Word document, Visio document, or avi of a dancing |
||||
baby into a database column, even if you will fill up your server's hard disk after a while! |
||||
|
||||
|
||||
@ -1,39 +1,58 @@ |
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by psqlodbc.rc
|
||||
//
|
||||
#define IDS_BADDSN 1 |
||||
#define IDS_MSGTITLE 2 |
||||
#define DRIVERCONNDIALOG 101 |
||||
#define IDC_DSNAME 400 |
||||
#define IDC_DSNAMETEXT 401 |
||||
#define IDC_DESC 404 |
||||
#define IDC_SERVER 407 |
||||
#define IDC_DATABASE 408 |
||||
#define CONFIGDSN 1001 |
||||
#define IDC_PORT 1002 |
||||
#define IDC_USER 1006 |
||||
#define IDC_PASSWORD 1009 |
||||
#define IDC_READONLY 1011 |
||||
#define READONLY_EDIT 1012 |
||||
#define SAVEPASSWORD_EDIT 1013 |
||||
#define IDC_COMMLOG 1014 |
||||
#define COMMLOG_EDIT 1015 |
||||
#define IDC_PG62 1016 |
||||
#define PG62_EDIT 1017 |
||||
#define SERVER_EDIT 1501 |
||||
#define PORT_EDIT 1502 |
||||
#define DATABASE_EDIT 1503 |
||||
#define USERNAME_EDIT 1504 |
||||
#define PASSWORD_EDIT 1505 |
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED |
||||
#ifndef APSTUDIO_READONLY_SYMBOLS |
||||
#define _APS_NEXT_RESOURCE_VALUE 102 |
||||
#define _APS_NEXT_COMMAND_VALUE 40001 |
||||
#define _APS_NEXT_CONTROL_VALUE 1018 |
||||
#define _APS_NEXT_SYMED_VALUE 101 |
||||
#endif |
||||
#endif |
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by psqlodbc.rc
|
||||
//
|
||||
#define IDS_BADDSN 1 |
||||
#define IDS_MSGTITLE 2 |
||||
#define DLG_OPTIONS_DRV 102 |
||||
#define DLG_OPTIONS_DS 103 |
||||
#define IDC_DSNAME 400 |
||||
#define IDC_DSNAMETEXT 401 |
||||
#define IDC_DESC 404 |
||||
#define IDC_SERVER 407 |
||||
#define IDC_DATABASE 408 |
||||
#define DLG_CONFIG 1001 |
||||
#define IDC_PORT 1002 |
||||
#define IDC_USER 1006 |
||||
#define IDC_PASSWORD 1009 |
||||
#define DS_READONLY 1011 |
||||
#define DS_SHOWOIDCOLUMN 1012 |
||||
#define DS_FAKEOIDINDEX 1013 |
||||
#define DRV_COMMLOG 1014 |
||||
#define DS_PG62 1016 |
||||
#define IDC_DATASOURCE 1018 |
||||
#define DRV_OPTIMIZER 1019 |
||||
#define DS_CONNSETTINGS 1020 |
||||
#define IDC_DRIVER 1021 |
||||
#define DS_UNKNOWN_MAX 1023 |
||||
#define DS_UNKNOWN_DONTKNOW 1024 |
||||
#define DRV_CONNSETTINGS 1031 |
||||
#define DRV_UNIQUEINDEX 1032 |
||||
#define DRV_UNKNOWN_MAX 1035 |
||||
#define DRV_UNKNOWN_DONTKNOW 1036 |
||||
#define DRV_READONLY 1037 |
||||
#define IDC_DESCTEXT 1039 |
||||
#define DRV_MSG_LABEL 1040 |
||||
#define DRV_UNKNOWN_LONGEST 1041 |
||||
#define DS_UNKNOWN_LONGEST 1042 |
||||
#define DRV_TEXT_LONGVARCHAR 1043 |
||||
#define DRV_UNKNOWNS_LONGVARCHAR 1044 |
||||
#define DRV_CACHE_SIZE 1045 |
||||
#define DRV_VARCHAR_SIZE 1046 |
||||
#define DRV_LONGVARCHAR_SIZE 1047 |
||||
#define IDDEFAULTS 1048 |
||||
#define DRV_USEDECLAREFETCH 1049 |
||||
#define DRV_BOOLS_CHAR 1050 |
||||
#define DS_SHOWSYSTEMTABLES 1051 |
||||
#define DRV_EXTRASYSTABLEPREFIXES 1051 |
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED |
||||
#ifndef APSTUDIO_READONLY_SYMBOLS |
||||
#define _APS_NEXT_RESOURCE_VALUE 104 |
||||
#define _APS_NEXT_COMMAND_VALUE 40001 |
||||
#define _APS_NEXT_CONTROL_VALUE 1054 |
||||
#define _APS_NEXT_SYMED_VALUE 101 |
||||
#endif |
||||
#endif |
||||
|
||||
Loading…
Reference in new issue