Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
89d6f680
Commit
89d6f680
authored
Jun 06, 2002
by
Hiroshi Inoue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add *Int8 As* option.
parent
52069570
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1084 additions
and
697 deletions
+1084
-697
src/interfaces/odbc/connection.c
src/interfaces/odbc/connection.c
+31
-0
src/interfaces/odbc/connection.h
src/interfaces/odbc/connection.h
+4
-0
src/interfaces/odbc/convert.c
src/interfaces/odbc/convert.c
+0
-2
src/interfaces/odbc/descriptor.h
src/interfaces/odbc/descriptor.h
+2
-1
src/interfaces/odbc/dlg_specific.c
src/interfaces/odbc/dlg_specific.c
+131
-479
src/interfaces/odbc/dlg_specific.h
src/interfaces/odbc/dlg_specific.h
+8
-1
src/interfaces/odbc/dlg_wingui.c
src/interfaces/odbc/dlg_wingui.c
+486
-0
src/interfaces/odbc/drvconn.c
src/interfaces/odbc/drvconn.c
+6
-5
src/interfaces/odbc/info.c
src/interfaces/odbc/info.c
+11
-11
src/interfaces/odbc/info30.c
src/interfaces/odbc/info30.c
+6
-6
src/interfaces/odbc/misc.c
src/interfaces/odbc/misc.c
+7
-6
src/interfaces/odbc/misc.h
src/interfaces/odbc/misc.h
+1
-1
src/interfaces/odbc/multibyte.c
src/interfaces/odbc/multibyte.c
+38
-0
src/interfaces/odbc/parse.c
src/interfaces/odbc/parse.c
+116
-42
src/interfaces/odbc/pgtypes.c
src/interfaces/odbc/pgtypes.c
+22
-3
src/interfaces/odbc/psqlodbc.h
src/interfaces/odbc/psqlodbc.h
+1
-1
src/interfaces/odbc/psqlodbc.rc
src/interfaces/odbc/psqlodbc.rc
+145
-107
src/interfaces/odbc/resource.h
src/interfaces/odbc/resource.h
+11
-1
src/interfaces/odbc/results.c
src/interfaces/odbc/results.c
+3
-1
src/interfaces/odbc/setup.c
src/interfaces/odbc/setup.c
+13
-29
src/interfaces/odbc/statement.c
src/interfaces/odbc/statement.c
+6
-0
src/interfaces/odbc/win32.mak
src/interfaces/odbc/win32.mak
+12
-0
src/interfaces/odbc/win32_30.mak
src/interfaces/odbc/win32_30.mak
+12
-1
src/interfaces/odbc/win32_30w.mak
src/interfaces/odbc/win32_30w.mak
+12
-0
No files found.
src/interfaces/odbc/connection.c
View file @
89d6f680
...
...
@@ -240,6 +240,7 @@ CC_conninfo_init(ConnInfo *conninfo)
conninfo
->
allow_keyset
=
-
1
;
conninfo
->
lf_conversion
=
-
1
;
conninfo
->
true_is_minus1
=
-
1
;
conninfo
->
int8_as
=
-
101
;
memcpy
(
&
(
conninfo
->
drivers
),
&
globals
,
sizeof
(
globals
));
}
/*
...
...
@@ -298,6 +299,7 @@ CC_Constructor()
rv
->
client_encoding
=
NULL
;
rv
->
server_encoding
=
NULL
;
#endif
/* MULTIBYTE */
rv
->
current_schema
=
NULL
;
/* Initialize statement options to defaults */
...
...
@@ -503,6 +505,9 @@ CC_cleanup(ConnectionClass *self)
free
(
self
->
server_encoding
);
self
->
server_encoding
=
NULL
;
#endif
/* MULTIBYTE */
if
(
self
->
current_schema
)
free
(
self
->
current_schema
);
self
->
current_schema
=
NULL
;
/* Free cached table info */
if
(
self
->
col_info
)
{
...
...
@@ -513,6 +518,8 @@ CC_cleanup(ConnectionClass *self)
if
(
self
->
col_info
[
i
]
->
result
)
/* Free the SQLColumns result structure */
QR_Destructor
(
self
->
col_info
[
i
]
->
result
);
if
(
self
->
col_info
[
i
]
->
schema
)
free
(
self
->
col_info
[
i
]
->
schema
);
free
(
self
->
col_info
[
i
]);
}
free
(
self
->
col_info
);
...
...
@@ -986,6 +993,9 @@ another_version_retry:
}
}
}
#else
{
}
#endif
/* UNICODE_SUPPORT */
}
#ifdef UNICODE_SUPPORT
...
...
@@ -2046,6 +2056,27 @@ CC_get_max_query_len(const ConnectionClass *conn)
return
value
;
}
/*
* This deosn't really return the CURRENT SCHEMA
* but there's no alternative.
*/
const
char
*
CC_get_current_schema
(
ConnectionClass
*
conn
)
{
if
(
!
conn
->
current_schema
&&
conn
->
schema_support
)
{
QResultClass
*
res
;
if
(
res
=
CC_send_query
(
conn
,
"select current_schema()"
,
NULL
,
CLEAR_RESULT_ON_ABORT
),
res
)
{
if
(
QR_get_num_total_tuples
(
res
)
==
1
)
conn
->
current_schema
=
strdup
(
QR_get_value_backend_row
(
res
,
0
,
0
));
QR_Destructor
(
res
);
}
}
return
(
const
char
*
)
conn
->
current_schema
;
}
int
CC_send_cancel_request
(
const
ConnectionClass
*
conn
)
{
...
...
src/interfaces/odbc/connection.h
View file @
89d6f680
...
...
@@ -170,6 +170,7 @@ typedef struct
char
updatable_cursors
;
char
lf_conversion
;
char
true_is_minus1
;
char
int8_as
;
GLOBAL_VALUES
drivers
;
/* moved from driver's option */
}
ConnInfo
;
...
...
@@ -219,6 +220,7 @@ typedef struct
struct
col_info
{
QResultClass
*
result
;
char
*
schema
;
char
name
[
MAX_TABLE_LEN
+
1
];
};
...
...
@@ -298,6 +300,7 @@ struct ConnectionClass_
int
be_pid
;
/* pid returned by backend */
int
be_key
;
/* auth code needed to send cancel */
UInt4
isolation
;
char
*
current_schema
;
};
...
...
@@ -343,6 +346,7 @@ int CC_send_cancel_request(const ConnectionClass *conn);
void
CC_on_commit
(
ConnectionClass
*
conn
);
void
CC_on_abort
(
ConnectionClass
*
conn
,
UDWORD
opt
);
void
ProcessRollback
(
ConnectionClass
*
conn
,
BOOL
undo
);
const
char
*
CC_get_current_schema
(
ConnectionClass
*
conn
);
/* CC_send_query options */
#define CLEAR_RESULT_ON_ABORT 1L
...
...
src/interfaces/odbc/convert.c
View file @
89d6f680
...
...
@@ -497,7 +497,6 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
*/
bZone
=
FALSE
;
/* time zone stuff is unreliable */
timestamp2stime
(
value
,
&
st
,
&
bZone
,
&
zone
);
inolog
(
"2stime fr=%d
\n
"
,
st
.
fr
);
}
else
{
...
...
@@ -1096,7 +1095,6 @@ inolog("2stime fr=%d\n", st.fr);
case
SQL_C_ULONG
:
len
=
4
;
inolog
(
"rgb=%x + %d, pcb=%x, set %s
\n
"
,
rgbValue
,
bind_row
*
bind_size
,
pcbValue
,
neut_str
);
if
(
bind_size
>
0
)
*
(
UDWORD
*
)
((
char
*
)
rgbValue
+
(
bind_row
*
bind_size
))
=
atol
(
neut_str
);
else
...
...
src/interfaces/odbc/descriptor.h
View file @
89d6f680
...
...
@@ -5,7 +5,7 @@
*
* Comments: See "notice.txt" for copyright and license information.
*
* $Id: descriptor.h,v 1.
5 2002/05/22 05:51:03
inoue Exp $
* $Id: descriptor.h,v 1.
6 2002/06/06 04:50:47
inoue Exp $
*
*/
...
...
@@ -41,6 +41,7 @@ typedef struct
char
dot
[
MAX_TABLE_LEN
+
1
];
char
name
[
MAX_COLUMN_LEN
+
1
];
char
alias
[
MAX_COLUMN_LEN
+
1
];
char
*
schema
;
}
FIELD_INFO
;
Int4
FI_precision
(
const
FIELD_INFO
*
);
Int4
FI_scale
(
const
FIELD_INFO
*
);
...
...
src/interfaces/odbc/dlg_specific.c
View file @
89d6f680
...
...
@@ -38,483 +38,6 @@
extern
GLOBAL_VALUES
globals
;
#ifdef WIN32
static
int
driver_optionsDraw
(
HWND
,
const
ConnInfo
*
,
int
src
,
BOOL
enable
);
static
int
driver_options_update
(
HWND
hdlg
,
ConnInfo
*
ci
,
BOOL
);
static
void
updateCommons
(
const
ConnInfo
*
ci
);
#endif
#ifdef WIN32
void
SetDlgStuff
(
HWND
hdlg
,
const
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
));
}
static
int
driver_optionsDraw
(
HWND
hdlg
,
const
ConnInfo
*
ci
,
int
src
,
BOOL
enable
)
{
const
GLOBAL_VALUES
*
comval
;
static
BOOL
defset
=
FALSE
;
static
GLOBAL_VALUES
defval
;
switch
(
src
)
{
case
0
:
/* driver common */
comval
=
&
globals
;
break
;
case
1
:
/* dsn specific */
comval
=
&
(
ci
->
drivers
);
break
;
case
2
:
/* default */
if
(
!
defset
)
{
defval
.
commlog
=
DEFAULT_COMMLOG
;
defval
.
disable_optimizer
=
DEFAULT_OPTIMIZER
;
defval
.
ksqo
=
DEFAULT_KSQO
;
defval
.
unique_index
=
DEFAULT_UNIQUEINDEX
;
defval
.
onlyread
=
DEFAULT_READONLY
;
defval
.
use_declarefetch
=
DEFAULT_USEDECLAREFETCH
;
defval
.
parse
=
DEFAULT_PARSE
;
defval
.
cancel_as_freestmt
=
DEFAULT_CANCELASFREESTMT
;
defval
.
debug
=
DEFAULT_DEBUG
;
/* Unknown Sizes */
defval
.
unknown_sizes
=
DEFAULT_UNKNOWNSIZES
;
defval
.
text_as_longvarchar
=
DEFAULT_TEXTASLONGVARCHAR
;
defval
.
unknowns_as_longvarchar
=
DEFAULT_UNKNOWNSASLONGVARCHAR
;
defval
.
bools_as_char
=
DEFAULT_BOOLSASCHAR
;
}
defset
=
TRUE
;
comval
=
&
defval
;
break
;
}
CheckDlgButton
(
hdlg
,
DRV_COMMLOG
,
comval
->
commlog
);
#ifndef Q_LOG
EnableWindow
(
GetDlgItem
(
hdlg
,
DRV_COMMLOG
),
FALSE
);
#endif
/* Q_LOG */
CheckDlgButton
(
hdlg
,
DRV_OPTIMIZER
,
comval
->
disable_optimizer
);
CheckDlgButton
(
hdlg
,
DRV_KSQO
,
comval
->
ksqo
);
CheckDlgButton
(
hdlg
,
DRV_UNIQUEINDEX
,
comval
->
unique_index
);
/* EnableWindow(GetDlgItem(hdlg, DRV_UNIQUEINDEX), enable); */
CheckDlgButton
(
hdlg
,
DRV_READONLY
,
comval
->
onlyread
);
EnableWindow
(
GetDlgItem
(
hdlg
,
DRV_READONLY
),
enable
);
CheckDlgButton
(
hdlg
,
DRV_USEDECLAREFETCH
,
comval
->
use_declarefetch
);
/* Unknown Sizes clear */
CheckDlgButton
(
hdlg
,
DRV_UNKNOWN_DONTKNOW
,
0
);
CheckDlgButton
(
hdlg
,
DRV_UNKNOWN_LONGEST
,
0
);
CheckDlgButton
(
hdlg
,
DRV_UNKNOWN_MAX
,
0
);
/* Unknown (Default) Data Type sizes */
switch
(
comval
->
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
,
comval
->
text_as_longvarchar
);
CheckDlgButton
(
hdlg
,
DRV_UNKNOWNS_LONGVARCHAR
,
comval
->
unknowns_as_longvarchar
);
CheckDlgButton
(
hdlg
,
DRV_BOOLS_CHAR
,
comval
->
bools_as_char
);
CheckDlgButton
(
hdlg
,
DRV_PARSE
,
comval
->
parse
);
CheckDlgButton
(
hdlg
,
DRV_CANCELASFREESTMT
,
comval
->
cancel_as_freestmt
);
CheckDlgButton
(
hdlg
,
DRV_DEBUG
,
comval
->
debug
);
#ifndef MY_LOG
EnableWindow
(
GetDlgItem
(
hdlg
,
DRV_DEBUG
),
FALSE
);
#endif
/* MY_LOG */
SetDlgItemInt
(
hdlg
,
DRV_CACHE_SIZE
,
comval
->
fetch_max
,
FALSE
);
SetDlgItemInt
(
hdlg
,
DRV_VARCHAR_SIZE
,
comval
->
max_varchar_size
,
FALSE
);
SetDlgItemInt
(
hdlg
,
DRV_LONGVARCHAR_SIZE
,
comval
->
max_longvarchar_size
,
TRUE
);
SetDlgItemText
(
hdlg
,
DRV_EXTRASYSTABLEPREFIXES
,
comval
->
extra_systable_prefixes
);
/* Driver Connection Settings */
SetDlgItemText
(
hdlg
,
DRV_CONNSETTINGS
,
comval
->
conn_settings
);
EnableWindow
(
GetDlgItem
(
hdlg
,
DRV_CONNSETTINGS
),
enable
);
return
0
;
}
static
int
driver_options_update
(
HWND
hdlg
,
ConnInfo
*
ci
,
BOOL
updateProfile
)
{
GLOBAL_VALUES
*
comval
;
if
(
ci
)
comval
=
&
(
ci
->
drivers
);
else
comval
=
&
globals
;
comval
->
commlog
=
IsDlgButtonChecked
(
hdlg
,
DRV_COMMLOG
);
comval
->
disable_optimizer
=
IsDlgButtonChecked
(
hdlg
,
DRV_OPTIMIZER
);
comval
->
ksqo
=
IsDlgButtonChecked
(
hdlg
,
DRV_KSQO
);
comval
->
unique_index
=
IsDlgButtonChecked
(
hdlg
,
DRV_UNIQUEINDEX
);
if
(
!
ci
)
{
comval
->
onlyread
=
IsDlgButtonChecked
(
hdlg
,
DRV_READONLY
);
}
comval
->
use_declarefetch
=
IsDlgButtonChecked
(
hdlg
,
DRV_USEDECLAREFETCH
);
/* Unknown (Default) Data Type sizes */
if
(
IsDlgButtonChecked
(
hdlg
,
DRV_UNKNOWN_MAX
))
comval
->
unknown_sizes
=
UNKNOWNS_AS_MAX
;
else
if
(
IsDlgButtonChecked
(
hdlg
,
DRV_UNKNOWN_DONTKNOW
))
comval
->
unknown_sizes
=
UNKNOWNS_AS_DONTKNOW
;
else
if
(
IsDlgButtonChecked
(
hdlg
,
DRV_UNKNOWN_LONGEST
))
comval
->
unknown_sizes
=
UNKNOWNS_AS_LONGEST
;
else
comval
->
unknown_sizes
=
UNKNOWNS_AS_MAX
;
comval
->
text_as_longvarchar
=
IsDlgButtonChecked
(
hdlg
,
DRV_TEXT_LONGVARCHAR
);
comval
->
unknowns_as_longvarchar
=
IsDlgButtonChecked
(
hdlg
,
DRV_UNKNOWNS_LONGVARCHAR
);
comval
->
bools_as_char
=
IsDlgButtonChecked
(
hdlg
,
DRV_BOOLS_CHAR
);
comval
->
parse
=
IsDlgButtonChecked
(
hdlg
,
DRV_PARSE
);
comval
->
cancel_as_freestmt
=
IsDlgButtonChecked
(
hdlg
,
DRV_CANCELASFREESTMT
);
comval
->
debug
=
IsDlgButtonChecked
(
hdlg
,
DRV_DEBUG
);
comval
->
fetch_max
=
GetDlgItemInt
(
hdlg
,
DRV_CACHE_SIZE
,
NULL
,
FALSE
);
comval
->
max_varchar_size
=
GetDlgItemInt
(
hdlg
,
DRV_VARCHAR_SIZE
,
NULL
,
FALSE
);
comval
->
max_longvarchar_size
=
GetDlgItemInt
(
hdlg
,
DRV_LONGVARCHAR_SIZE
,
NULL
,
TRUE
);
/* allows for
* SQL_NO_TOTAL */
GetDlgItemText
(
hdlg
,
DRV_EXTRASYSTABLEPREFIXES
,
comval
->
extra_systable_prefixes
,
sizeof
(
comval
->
extra_systable_prefixes
));
/* Driver Connection Settings */
if
(
!
ci
)
GetDlgItemText
(
hdlg
,
DRV_CONNSETTINGS
,
comval
->
conn_settings
,
sizeof
(
comval
->
conn_settings
));
if
(
updateProfile
)
updateCommons
(
ci
);
/* fall through */
return
0
;
}
int
CALLBACK
driver_optionsProc
(
HWND
hdlg
,
UINT
wMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
ConnInfo
*
ci
;
switch
(
wMsg
)
{
case
WM_INITDIALOG
:
SetWindowLong
(
hdlg
,
DWL_USER
,
lParam
);
/* save for OK etc */
ci
=
(
ConnInfo
*
)
lParam
;
CheckDlgButton
(
hdlg
,
DRV_OR_DSN
,
0
);
if
(
ci
&&
ci
->
dsn
&&
ci
->
dsn
[
0
])
SetWindowText
(
hdlg
,
"Advanced Options (per DSN)"
);
else
{
SetWindowText
(
hdlg
,
"Advanced Options (Connection)"
);
ShowWindow
(
GetDlgItem
(
hdlg
,
DRV_OR_DSN
),
SW_HIDE
);
}
driver_optionsDraw
(
hdlg
,
ci
,
1
,
FALSE
);
break
;
case
WM_COMMAND
:
switch
(
GET_WM_COMMAND_ID
(
wParam
,
lParam
))
{
case
IDOK
:
ci
=
(
ConnInfo
*
)
GetWindowLong
(
hdlg
,
DWL_USER
);
driver_options_update
(
hdlg
,
IsDlgButtonChecked
(
hdlg
,
DRV_OR_DSN
)
?
NULL
:
ci
,
ci
&&
ci
->
dsn
&&
ci
->
dsn
[
0
]);
case
IDCANCEL
:
EndDialog
(
hdlg
,
GET_WM_COMMAND_ID
(
wParam
,
lParam
)
==
IDOK
);
return
TRUE
;
case
IDDEFAULTS
:
if
(
IsDlgButtonChecked
(
hdlg
,
DRV_OR_DSN
))
driver_optionsDraw
(
hdlg
,
NULL
,
2
,
TRUE
);
else
{
ConnInfo
*
ci
=
(
ConnInfo
*
)
GetWindowLong
(
hdlg
,
DWL_USER
);
driver_optionsDraw
(
hdlg
,
ci
,
0
,
FALSE
);
}
break
;
case
DRV_OR_DSN
:
if
(
GET_WM_COMMAND_CMD
(
wParam
,
lParam
)
==
BN_CLICKED
)
{
mylog
(
"DRV_OR_DSN clicked
\n
"
);
if
(
IsDlgButtonChecked
(
hdlg
,
DRV_OR_DSN
))
{
SetWindowText
(
hdlg
,
"Advanced Options (Common)"
);
driver_optionsDraw
(
hdlg
,
NULL
,
0
,
TRUE
);
}
else
{
ConnInfo
*
ci
=
(
ConnInfo
*
)
GetWindowLong
(
hdlg
,
DWL_USER
);
SetWindowText
(
hdlg
,
"Advanced Options (per DSN)"
);
driver_optionsDraw
(
hdlg
,
ci
,
ci
?
1
:
0
,
ci
==
NULL
);
}
}
break
;
}
}
return
FALSE
;
}
int
CALLBACK
ds_optionsProc
(
HWND
hdlg
,
UINT
wMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
ConnInfo
*
ci
;
char
buf
[
128
];
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
->
onlyread
));
/* Protocol */
if
(
strncmp
(
ci
->
protocol
,
PG62
,
strlen
(
PG62
))
==
0
)
CheckDlgButton
(
hdlg
,
DS_PG62
,
1
);
else
if
(
strncmp
(
ci
->
protocol
,
PG63
,
strlen
(
PG63
))
==
0
)
CheckDlgButton
(
hdlg
,
DS_PG63
,
1
);
else
/* latest */
CheckDlgButton
(
hdlg
,
DS_PG64
,
1
);
CheckDlgButton
(
hdlg
,
DS_SHOWOIDCOLUMN
,
atoi
(
ci
->
show_oid_column
));
CheckDlgButton
(
hdlg
,
DS_FAKEOIDINDEX
,
atoi
(
ci
->
fake_oid_index
));
CheckDlgButton
(
hdlg
,
DS_ROWVERSIONING
,
atoi
(
ci
->
row_versioning
));
CheckDlgButton
(
hdlg
,
DS_SHOWSYSTEMTABLES
,
atoi
(
ci
->
show_system_tables
));
CheckDlgButton
(
hdlg
,
DS_DISALLOWPREMATURE
,
ci
->
disallow_premature
);
CheckDlgButton
(
hdlg
,
DS_LFCONVERSION
,
ci
->
lf_conversion
);
CheckDlgButton
(
hdlg
,
DS_TRUEISMINUS1
,
ci
->
true_is_minus1
);
CheckDlgButton
(
hdlg
,
DS_UPDATABLECURSORS
,
ci
->
allow_keyset
);
#ifndef DRIVER_CURSOR_IMPLEMENT
EnableWindow
(
GetDlgItem
(
hdlg
,
DS_UPDATABLECURSORS
),
FALSE
);
#endif
/* DRIVER_CURSOR_IMPLEMENT */
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
->
onlyread
,
"%d"
,
IsDlgButtonChecked
(
hdlg
,
DS_READONLY
));
/* Protocol */
if
(
IsDlgButtonChecked
(
hdlg
,
DS_PG62
))
strcpy
(
ci
->
protocol
,
PG62
);
else
if
(
IsDlgButtonChecked
(
hdlg
,
DS_PG63
))
strcpy
(
ci
->
protocol
,
PG63
);
else
/* latest */
strcpy
(
ci
->
protocol
,
PG64
);
sprintf
(
ci
->
show_system_tables
,
"%d"
,
IsDlgButtonChecked
(
hdlg
,
DS_SHOWSYSTEMTABLES
));
sprintf
(
ci
->
row_versioning
,
"%d"
,
IsDlgButtonChecked
(
hdlg
,
DS_ROWVERSIONING
));
ci
->
disallow_premature
=
IsDlgButtonChecked
(
hdlg
,
DS_DISALLOWPREMATURE
);
ci
->
lf_conversion
=
IsDlgButtonChecked
(
hdlg
,
DS_LFCONVERSION
);
ci
->
true_is_minus1
=
IsDlgButtonChecked
(
hdlg
,
DS_TRUEISMINUS1
);
#ifdef DRIVER_CURSOR_IMPLEMENT
ci
->
allow_keyset
=
IsDlgButtonChecked
(
hdlg
,
DS_UPDATABLECURSORS
);
#endif
/* DRIVER_CURSOR_IMPLEMENT */
/* 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
;
}
/*
* This function writes any global parameters (that can be manipulated)
* to the ODBCINST.INI portion of the registry
*/
static
void
updateCommons
(
const
ConnInfo
*
ci
)
{
const
char
*
sectionName
;
const
char
*
fileName
;
const
GLOBAL_VALUES
*
comval
;
char
tmp
[
128
];
if
(
ci
)
if
(
ci
->
dsn
&&
ci
->
dsn
[
0
])
{
mylog
(
"DSN=%s updating
\n
"
,
ci
->
dsn
);
comval
=
&
(
ci
->
drivers
);
sectionName
=
ci
->
dsn
;
fileName
=
ODBC_INI
;
}
else
{
mylog
(
"ci but dsn==NULL
\n
"
);
return
;
}
else
{
mylog
(
"drivers updating
\n
"
);
comval
=
&
globals
;
sectionName
=
DBMS_NAME
;
fileName
=
ODBCINST_INI
;
}
sprintf
(
tmp
,
"%d"
,
comval
->
fetch_max
);
SQLWritePrivateProfileString
(
sectionName
,
INI_FETCH
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
commlog
);
SQLWritePrivateProfileString
(
sectionName
,
INI_COMMLOG
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
debug
);
SQLWritePrivateProfileString
(
sectionName
,
INI_DEBUG
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
disable_optimizer
);
SQLWritePrivateProfileString
(
sectionName
,
INI_OPTIMIZER
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
ksqo
);
SQLWritePrivateProfileString
(
sectionName
,
INI_KSQO
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
unique_index
);
SQLWritePrivateProfileString
(
sectionName
,
INI_UNIQUEINDEX
,
tmp
,
fileName
);
/*
* Never update the onlyread from this module.
*/
if
(
!
ci
)
{
sprintf
(
tmp
,
"%d"
,
comval
->
onlyread
);
SQLWritePrivateProfileString
(
sectionName
,
INI_READONLY
,
tmp
,
fileName
);
}
sprintf
(
tmp
,
"%d"
,
comval
->
use_declarefetch
);
SQLWritePrivateProfileString
(
sectionName
,
INI_USEDECLAREFETCH
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
unknown_sizes
);
SQLWritePrivateProfileString
(
sectionName
,
INI_UNKNOWNSIZES
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
text_as_longvarchar
);
SQLWritePrivateProfileString
(
sectionName
,
INI_TEXTASLONGVARCHAR
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
unknowns_as_longvarchar
);
SQLWritePrivateProfileString
(
sectionName
,
INI_UNKNOWNSASLONGVARCHAR
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
bools_as_char
);
SQLWritePrivateProfileString
(
sectionName
,
INI_BOOLSASCHAR
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
parse
);
SQLWritePrivateProfileString
(
sectionName
,
INI_PARSE
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
cancel_as_freestmt
);
SQLWritePrivateProfileString
(
sectionName
,
INI_CANCELASFREESTMT
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
max_varchar_size
);
SQLWritePrivateProfileString
(
sectionName
,
INI_MAXVARCHARSIZE
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
max_longvarchar_size
);
SQLWritePrivateProfileString
(
sectionName
,
INI_MAXLONGVARCHARSIZE
,
tmp
,
fileName
);
SQLWritePrivateProfileString
(
sectionName
,
INI_EXTRASYSTABLEPREFIXES
,
comval
->
extra_systable_prefixes
,
fileName
);
/*
* Never update the conn_setting from this module
* SQLWritePrivateProfileString(sectionName, INI_CONNSETTINGS,
* comval->conn_settings, fileName);
*/
}
#endif
/* WIN32 */
void
makeConnectString
(
char
*
connect_string
,
const
ConnInfo
*
ci
,
UWORD
len
)
{
...
...
@@ -540,7 +63,7 @@ makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len)
hlen
=
strlen
(
connect_string
);
if
(
!
abbrev
)
sprintf
(
&
connect_string
[
hlen
],
";%s=%s;%s=%s;%s=%s;%s=%s;%s=%s;%s=%s;%s=%s;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%s;%s=%d;%s=%d;%s=%d;%s=%d"
,
";%s=%s;%s=%s;%s=%s;%s=%s;%s=%s;%s=%s;%s=%s;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%s;%s=%d;%s=%d;%s=%d;%s=%d
;%s=%d
"
,
INI_READONLY
,
ci
->
onlyread
,
INI_PROTOCOL
,
...
...
@@ -594,6 +117,8 @@ makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len)
INI_DISALLOWPREMATURE
,
ci
->
disallow_premature
,
INI_TRUEISMINUS1
,
ci
->
true_is_minus1
,
INI_INT8AS
,
ci
->
true_is_minus1
);
/* Abbrebiation is needed ? */
if
(
abbrev
||
strlen
(
connect_string
)
>=
len
)
...
...
@@ -654,12 +179,14 @@ makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len)
flag
|=
BIT_TRUEISMINUS1
;
sprintf
(
&
connect_string
[
hlen
],
";A6=%s;A7=%d;A8=%d;B0=%d;B1=%d;C2=%s;CX=%02x%lx"
,
";A6=%s;A7=%d;A8=%d;B0=%d;B1=%d;
%s=%d;
C2=%s;CX=%02x%lx"
,
encoded_conn_settings
,
ci
->
drivers
.
fetch_max
,
ci
->
drivers
.
socket_buffersize
,
ci
->
drivers
.
max_varchar_size
,
ci
->
drivers
.
max_longvarchar_size
,
INI_INT8AS
,
ci
->
int8_as
,
ci
->
drivers
.
extra_systable_prefixes
,
EFFECTIVE_BIT_COUNT
,
flag
);
...
...
@@ -775,6 +302,8 @@ copyAttributes(ConnInfo *ci, const char *attribute, const char *value)
ci
->
lf_conversion
=
atoi
(
value
);
else
if
(
stricmp
(
attribute
,
INI_TRUEISMINUS1
)
==
0
)
ci
->
true_is_minus1
=
atoi
(
value
);
else
if
(
stricmp
(
attribute
,
INI_INT8AS
)
==
0
)
ci
->
int8_as
=
atoi
(
value
);
else
if
(
stricmp
(
attribute
,
"CX"
)
==
0
)
unfoldCXAttribute
(
ci
,
value
);
...
...
@@ -876,6 +405,8 @@ getDSNdefaults(ConnInfo *ci)
ci
->
lf_conversion
=
DEFAULT_LFCONVERSION
;
if
(
ci
->
true_is_minus1
<
0
)
ci
->
true_is_minus1
=
DEFAULT_TRUEISMINUS1
;
if
(
ci
->
int8_as
<
-
100
)
ci
->
int8_as
=
DEFAULT_INT8AS
;
}
...
...
@@ -981,6 +512,13 @@ getDSNinfo(ConnInfo *ci, char overwrite)
ci
->
true_is_minus1
=
atoi
(
temp
);
}
if
(
ci
->
int8_as
<
-
100
||
overwrite
)
{
SQLGetPrivateProfileString
(
DSN
,
INI_INT8AS
,
""
,
temp
,
sizeof
(
temp
),
ODBC_INI
);
if
(
temp
[
0
])
ci
->
int8_as
=
atoi
(
temp
);
}
/* Allow override of odbcinst.ini parameters here */
getCommonDefaults
(
DSN
,
ODBC_INI
,
ci
);
...
...
@@ -1013,6 +551,115 @@ getDSNinfo(ConnInfo *ci, char overwrite)
ci
->
translation_option
);
}
/*
* This function writes any global parameters (that can be manipulated)
* to the ODBCINST.INI portion of the registry
*/
void
writeDriverCommoninfo
(
const
ConnInfo
*
ci
)
{
const
char
*
sectionName
;
const
char
*
fileName
;
const
GLOBAL_VALUES
*
comval
;
char
tmp
[
128
];
if
(
ci
)
if
(
ci
->
dsn
&&
ci
->
dsn
[
0
])
{
mylog
(
"DSN=%s updating
\n
"
,
ci
->
dsn
);
comval
=
&
(
ci
->
drivers
);
sectionName
=
ci
->
dsn
;
fileName
=
ODBC_INI
;
}
else
{
mylog
(
"ci but dsn==NULL
\n
"
);
return
;
}
else
{
mylog
(
"drivers updating
\n
"
);
comval
=
&
globals
;
sectionName
=
DBMS_NAME
;
fileName
=
ODBCINST_INI
;
}
sprintf
(
tmp
,
"%d"
,
comval
->
fetch_max
);
SQLWritePrivateProfileString
(
sectionName
,
INI_FETCH
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
commlog
);
SQLWritePrivateProfileString
(
sectionName
,
INI_COMMLOG
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
debug
);
SQLWritePrivateProfileString
(
sectionName
,
INI_DEBUG
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
disable_optimizer
);
SQLWritePrivateProfileString
(
sectionName
,
INI_OPTIMIZER
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
ksqo
);
SQLWritePrivateProfileString
(
sectionName
,
INI_KSQO
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
unique_index
);
SQLWritePrivateProfileString
(
sectionName
,
INI_UNIQUEINDEX
,
tmp
,
fileName
);
/*
* Never update the onlyread from this module.
*/
if
(
!
ci
)
{
sprintf
(
tmp
,
"%d"
,
comval
->
onlyread
);
SQLWritePrivateProfileString
(
sectionName
,
INI_READONLY
,
tmp
,
fileName
);
}
sprintf
(
tmp
,
"%d"
,
comval
->
use_declarefetch
);
SQLWritePrivateProfileString
(
sectionName
,
INI_USEDECLAREFETCH
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
unknown_sizes
);
SQLWritePrivateProfileString
(
sectionName
,
INI_UNKNOWNSIZES
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
text_as_longvarchar
);
SQLWritePrivateProfileString
(
sectionName
,
INI_TEXTASLONGVARCHAR
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
unknowns_as_longvarchar
);
SQLWritePrivateProfileString
(
sectionName
,
INI_UNKNOWNSASLONGVARCHAR
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
bools_as_char
);
SQLWritePrivateProfileString
(
sectionName
,
INI_BOOLSASCHAR
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
parse
);
SQLWritePrivateProfileString
(
sectionName
,
INI_PARSE
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
cancel_as_freestmt
);
SQLWritePrivateProfileString
(
sectionName
,
INI_CANCELASFREESTMT
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
max_varchar_size
);
SQLWritePrivateProfileString
(
sectionName
,
INI_MAXVARCHARSIZE
,
tmp
,
fileName
);
sprintf
(
tmp
,
"%d"
,
comval
->
max_longvarchar_size
);
SQLWritePrivateProfileString
(
sectionName
,
INI_MAXLONGVARCHARSIZE
,
tmp
,
fileName
);
SQLWritePrivateProfileString
(
sectionName
,
INI_EXTRASYSTABLEPREFIXES
,
comval
->
extra_systable_prefixes
,
fileName
);
/*
* Never update the conn_setting from this module
* SQLWritePrivateProfileString(sectionName, INI_CONNSETTINGS,
* comval->conn_settings, fileName);
*/
}
/* This is for datasource based options only */
void
...
...
@@ -1109,6 +756,11 @@ writeDSNinfo(const ConnInfo *ci)
INI_TRUEISMINUS1
,
temp
,
ODBC_INI
);
sprintf
(
temp
,
"%d"
,
ci
->
int8_as
);
SQLWritePrivateProfileString
(
DSN
,
INI_INT8AS
,
temp
,
ODBC_INI
);
}
...
...
src/interfaces/odbc/dlg_specific.h
View file @
89d6f680
...
...
@@ -91,6 +91,7 @@
#define INI_UPDATABLECURSORS "UpdatableCursors"
#define INI_LFCONVERSION "LFConversion"
#define INI_TRUEISMINUS1 "TrueIsMinus1"
#define INI_INT8AS "BI"
/* Bit representaion for abbreviated connection strings */
#define BIT_LFCONVERSION (1L)
#define BIT_UPDATABLECURSORS (1L<<1)
...
...
@@ -160,6 +161,7 @@
#else
#define DEFAULT_LFCONVERSION 0
#endif
/* WIN32 */
#define DEFAULT_INT8AS 0
/* prototypes */
void
getCommonDefaults
(
const
char
*
section
,
const
char
*
filename
,
ConnInfo
*
ci
);
...
...
@@ -172,13 +174,18 @@ int CALLBACK driver_optionsProc(HWND hdlg,
UINT
wMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
int
CALLBACK
ds_optionsProc
(
HWND
hdlg
,
int
CALLBACK
ds_options1Proc
(
HWND
hdlg
,
UINT
wMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
int
CALLBACK
ds_options2Proc
(
HWND
hdlg
,
UINT
wMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
#endif
/* WIN32 */
void
updateGlobals
(
void
);
void
writeDriverCommoninfo
(
const
ConnInfo
*
ci
);
void
writeDSNinfo
(
const
ConnInfo
*
ci
);
void
getDSNdefaults
(
ConnInfo
*
ci
);
void
getDSNinfo
(
ConnInfo
*
ci
,
char
overwrite
);
...
...
src/interfaces/odbc/dlg_wingui.c
0 → 100644
View file @
89d6f680
#ifdef WIN32
/*-------
* Module: dlg_wingui.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.
*-------
*/
/* Multibyte support Eiji Tokuya 2001-03-15 */
#include "dlg_specific.h"
#include "convert.h"
#ifdef MULTIBYTE
#include "multibyte.h"
#endif
#include "pgapifunc.h"
#ifndef BOOL
#define BOOL int
#endif
#ifndef FALSE
#define FALSE (BOOL)0
#endif
#ifndef TRUE
#define TRUE (BOOL)1
#endif
extern
GLOBAL_VALUES
globals
;
extern
HINSTANCE
NEAR
s_hModule
;
static
int
driver_optionsDraw
(
HWND
,
const
ConnInfo
*
,
int
src
,
BOOL
enable
);
static
int
driver_options_update
(
HWND
hdlg
,
ConnInfo
*
ci
,
BOOL
);
void
SetDlgStuff
(
HWND
hdlg
,
const
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
));
}
static
int
driver_optionsDraw
(
HWND
hdlg
,
const
ConnInfo
*
ci
,
int
src
,
BOOL
enable
)
{
const
GLOBAL_VALUES
*
comval
;
static
BOOL
defset
=
FALSE
;
static
GLOBAL_VALUES
defval
;
switch
(
src
)
{
case
0
:
/* driver common */
comval
=
&
globals
;
break
;
case
1
:
/* dsn specific */
comval
=
&
(
ci
->
drivers
);
break
;
case
2
:
/* default */
if
(
!
defset
)
{
defval
.
commlog
=
DEFAULT_COMMLOG
;
defval
.
disable_optimizer
=
DEFAULT_OPTIMIZER
;
defval
.
ksqo
=
DEFAULT_KSQO
;
defval
.
unique_index
=
DEFAULT_UNIQUEINDEX
;
defval
.
onlyread
=
DEFAULT_READONLY
;
defval
.
use_declarefetch
=
DEFAULT_USEDECLAREFETCH
;
defval
.
parse
=
DEFAULT_PARSE
;
defval
.
cancel_as_freestmt
=
DEFAULT_CANCELASFREESTMT
;
defval
.
debug
=
DEFAULT_DEBUG
;
/* Unknown Sizes */
defval
.
unknown_sizes
=
DEFAULT_UNKNOWNSIZES
;
defval
.
text_as_longvarchar
=
DEFAULT_TEXTASLONGVARCHAR
;
defval
.
unknowns_as_longvarchar
=
DEFAULT_UNKNOWNSASLONGVARCHAR
;
defval
.
bools_as_char
=
DEFAULT_BOOLSASCHAR
;
}
defset
=
TRUE
;
comval
=
&
defval
;
break
;
}
ShowWindow
(
GetDlgItem
(
hdlg
,
DRV_MSG_LABEL2
),
enable
?
SW_SHOW
:
SW_HIDE
);
CheckDlgButton
(
hdlg
,
DRV_COMMLOG
,
comval
->
commlog
);
#ifndef Q_LOG
EnableWindow
(
GetDlgItem
(
hdlg
,
DRV_COMMLOG
),
FALSE
);
#endif
/* Q_LOG */
CheckDlgButton
(
hdlg
,
DRV_OPTIMIZER
,
comval
->
disable_optimizer
);
CheckDlgButton
(
hdlg
,
DRV_KSQO
,
comval
->
ksqo
);
CheckDlgButton
(
hdlg
,
DRV_UNIQUEINDEX
,
comval
->
unique_index
);
/* EnableWindow(GetDlgItem(hdlg, DRV_UNIQUEINDEX), enable); */
CheckDlgButton
(
hdlg
,
DRV_READONLY
,
comval
->
onlyread
);
EnableWindow
(
GetDlgItem
(
hdlg
,
DRV_READONLY
),
enable
);
CheckDlgButton
(
hdlg
,
DRV_USEDECLAREFETCH
,
comval
->
use_declarefetch
);
/* Unknown Sizes clear */
CheckDlgButton
(
hdlg
,
DRV_UNKNOWN_DONTKNOW
,
0
);
CheckDlgButton
(
hdlg
,
DRV_UNKNOWN_LONGEST
,
0
);
CheckDlgButton
(
hdlg
,
DRV_UNKNOWN_MAX
,
0
);
/* Unknown (Default) Data Type sizes */
switch
(
comval
->
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
,
comval
->
text_as_longvarchar
);
CheckDlgButton
(
hdlg
,
DRV_UNKNOWNS_LONGVARCHAR
,
comval
->
unknowns_as_longvarchar
);
CheckDlgButton
(
hdlg
,
DRV_BOOLS_CHAR
,
comval
->
bools_as_char
);
CheckDlgButton
(
hdlg
,
DRV_PARSE
,
comval
->
parse
);
CheckDlgButton
(
hdlg
,
DRV_CANCELASFREESTMT
,
comval
->
cancel_as_freestmt
);
CheckDlgButton
(
hdlg
,
DRV_DEBUG
,
comval
->
debug
);
#ifndef MY_LOG
EnableWindow
(
GetDlgItem
(
hdlg
,
DRV_DEBUG
),
FALSE
);
#endif
/* MY_LOG */
SetDlgItemInt
(
hdlg
,
DRV_CACHE_SIZE
,
comval
->
fetch_max
,
FALSE
);
SetDlgItemInt
(
hdlg
,
DRV_VARCHAR_SIZE
,
comval
->
max_varchar_size
,
FALSE
);
SetDlgItemInt
(
hdlg
,
DRV_LONGVARCHAR_SIZE
,
comval
->
max_longvarchar_size
,
TRUE
);
SetDlgItemText
(
hdlg
,
DRV_EXTRASYSTABLEPREFIXES
,
comval
->
extra_systable_prefixes
);
/* Driver Connection Settings */
SetDlgItemText
(
hdlg
,
DRV_CONNSETTINGS
,
comval
->
conn_settings
);
EnableWindow
(
GetDlgItem
(
hdlg
,
DRV_CONNSETTINGS
),
enable
);
ShowWindow
(
GetDlgItem
(
hdlg
,
IDPREVPAGE
),
enable
?
SW_HIDE
:
SW_SHOW
);
ShowWindow
(
GetDlgItem
(
hdlg
,
IDNEXTPAGE
),
enable
?
SW_HIDE
:
SW_SHOW
);
return
0
;
}
static
int
driver_options_update
(
HWND
hdlg
,
ConnInfo
*
ci
,
BOOL
updateProfile
)
{
GLOBAL_VALUES
*
comval
;
if
(
ci
)
comval
=
&
(
ci
->
drivers
);
else
comval
=
&
globals
;
comval
->
commlog
=
IsDlgButtonChecked
(
hdlg
,
DRV_COMMLOG
);
comval
->
disable_optimizer
=
IsDlgButtonChecked
(
hdlg
,
DRV_OPTIMIZER
);
comval
->
ksqo
=
IsDlgButtonChecked
(
hdlg
,
DRV_KSQO
);
comval
->
unique_index
=
IsDlgButtonChecked
(
hdlg
,
DRV_UNIQUEINDEX
);
if
(
!
ci
)
{
comval
->
onlyread
=
IsDlgButtonChecked
(
hdlg
,
DRV_READONLY
);
}
comval
->
use_declarefetch
=
IsDlgButtonChecked
(
hdlg
,
DRV_USEDECLAREFETCH
);
/* Unknown (Default) Data Type sizes */
if
(
IsDlgButtonChecked
(
hdlg
,
DRV_UNKNOWN_MAX
))
comval
->
unknown_sizes
=
UNKNOWNS_AS_MAX
;
else
if
(
IsDlgButtonChecked
(
hdlg
,
DRV_UNKNOWN_DONTKNOW
))
comval
->
unknown_sizes
=
UNKNOWNS_AS_DONTKNOW
;
else
if
(
IsDlgButtonChecked
(
hdlg
,
DRV_UNKNOWN_LONGEST
))
comval
->
unknown_sizes
=
UNKNOWNS_AS_LONGEST
;
else
comval
->
unknown_sizes
=
UNKNOWNS_AS_MAX
;
comval
->
text_as_longvarchar
=
IsDlgButtonChecked
(
hdlg
,
DRV_TEXT_LONGVARCHAR
);
comval
->
unknowns_as_longvarchar
=
IsDlgButtonChecked
(
hdlg
,
DRV_UNKNOWNS_LONGVARCHAR
);
comval
->
bools_as_char
=
IsDlgButtonChecked
(
hdlg
,
DRV_BOOLS_CHAR
);
comval
->
parse
=
IsDlgButtonChecked
(
hdlg
,
DRV_PARSE
);
comval
->
cancel_as_freestmt
=
IsDlgButtonChecked
(
hdlg
,
DRV_CANCELASFREESTMT
);
comval
->
debug
=
IsDlgButtonChecked
(
hdlg
,
DRV_DEBUG
);
comval
->
fetch_max
=
GetDlgItemInt
(
hdlg
,
DRV_CACHE_SIZE
,
NULL
,
FALSE
);
comval
->
max_varchar_size
=
GetDlgItemInt
(
hdlg
,
DRV_VARCHAR_SIZE
,
NULL
,
FALSE
);
comval
->
max_longvarchar_size
=
GetDlgItemInt
(
hdlg
,
DRV_LONGVARCHAR_SIZE
,
NULL
,
TRUE
);
/* allows for
* SQL_NO_TOTAL */
GetDlgItemText
(
hdlg
,
DRV_EXTRASYSTABLEPREFIXES
,
comval
->
extra_systable_prefixes
,
sizeof
(
comval
->
extra_systable_prefixes
));
/* Driver Connection Settings */
if
(
!
ci
)
GetDlgItemText
(
hdlg
,
DRV_CONNSETTINGS
,
comval
->
conn_settings
,
sizeof
(
comval
->
conn_settings
));
if
(
updateProfile
)
writeDriverCommoninfo
(
ci
);
/* fall through */
return
0
;
}
int
CALLBACK
driver_optionsProc
(
HWND
hdlg
,
UINT
wMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
ConnInfo
*
ci
;
switch
(
wMsg
)
{
case
WM_INITDIALOG
:
SetWindowLong
(
hdlg
,
DWL_USER
,
lParam
);
/* save for OK etc */
ci
=
(
ConnInfo
*
)
lParam
;
SetWindowText
(
hdlg
,
"Advanced Options (Default)"
);
SetWindowText
(
GetDlgItem
(
hdlg
,
IDOK
),
"Save"
);
ShowWindow
(
GetDlgItem
(
hdlg
,
IDAPPLY
),
SW_HIDE
);
driver_optionsDraw
(
hdlg
,
ci
,
0
,
TRUE
);
break
;
case
WM_COMMAND
:
switch
(
GET_WM_COMMAND_ID
(
wParam
,
lParam
))
{
case
IDOK
:
ci
=
(
ConnInfo
*
)
GetWindowLong
(
hdlg
,
DWL_USER
);
driver_options_update
(
hdlg
,
NULL
,
ci
&&
ci
->
dsn
&&
ci
->
dsn
[
0
]);
case
IDCANCEL
:
EndDialog
(
hdlg
,
GET_WM_COMMAND_ID
(
wParam
,
lParam
)
==
IDOK
);
return
TRUE
;
case
IDDEFAULTS
:
driver_optionsDraw
(
hdlg
,
NULL
,
2
,
TRUE
);
break
;
}
}
return
FALSE
;
}
int
CALLBACK
ds_options1Proc
(
HWND
hdlg
,
UINT
wMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
ConnInfo
*
ci
;
switch
(
wMsg
)
{
case
WM_INITDIALOG
:
SetWindowLong
(
hdlg
,
DWL_USER
,
lParam
);
/* save for OK etc */
ci
=
(
ConnInfo
*
)
lParam
;
if
(
ci
&&
ci
->
dsn
&&
ci
->
dsn
[
0
])
SetWindowText
(
hdlg
,
"Advanced Options (DSN 1/2)"
);
else
{
SetWindowText
(
hdlg
,
"Advanced Options (Connection 1/2)"
);
ShowWindow
(
GetDlgItem
(
hdlg
,
IDAPPLY
),
SW_HIDE
);
}
driver_optionsDraw
(
hdlg
,
ci
,
1
,
FALSE
);
break
;
case
WM_COMMAND
:
ci
=
(
ConnInfo
*
)
GetWindowLong
(
hdlg
,
DWL_USER
);
switch
(
GET_WM_COMMAND_ID
(
wParam
,
lParam
))
{
case
IDOK
:
driver_options_update
(
hdlg
,
ci
,
FALSE
);
case
IDCANCEL
:
EndDialog
(
hdlg
,
GET_WM_COMMAND_ID
(
wParam
,
lParam
)
==
IDOK
);
return
TRUE
;
case
IDAPPLY
:
driver_options_update
(
hdlg
,
ci
,
FALSE
);
SendMessage
(
GetWindow
(
hdlg
,
GW_OWNER
),
WM_COMMAND
,
wParam
,
lParam
);
break
;
case
IDDEFAULTS
:
driver_optionsDraw
(
hdlg
,
ci
,
0
,
FALSE
);
break
;
case
IDNEXTPAGE
:
driver_options_update
(
hdlg
,
ci
,
FALSE
);
EndDialog
(
hdlg
,
FALSE
);
DialogBoxParam
(
s_hModule
,
MAKEINTRESOURCE
(
DLG_OPTIONS_DS
),
hdlg
,
ds_options2Proc
,
(
LPARAM
)
ci
);
break
;
}
}
return
FALSE
;
}
int
CALLBACK
ds_options2Proc
(
HWND
hdlg
,
UINT
wMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
ConnInfo
*
ci
;
char
buf
[
128
];
DWORD
cmd
;
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 2/2)"
);
ShowWindow
(
GetDlgItem
(
hdlg
,
IDAPPLY
),
SW_HIDE
);
}
else
{
sprintf
(
buf
,
"Advanced Options (%s) 2/2"
,
ci
->
dsn
);
SetWindowText
(
hdlg
,
buf
);
}
/* Readonly */
CheckDlgButton
(
hdlg
,
DS_READONLY
,
atoi
(
ci
->
onlyread
));
/* Protocol */
if
(
strncmp
(
ci
->
protocol
,
PG62
,
strlen
(
PG62
))
==
0
)
CheckDlgButton
(
hdlg
,
DS_PG62
,
1
);
else
if
(
strncmp
(
ci
->
protocol
,
PG63
,
strlen
(
PG63
))
==
0
)
CheckDlgButton
(
hdlg
,
DS_PG63
,
1
);
else
/* latest */
CheckDlgButton
(
hdlg
,
DS_PG64
,
1
);
/* Int8 As */
switch
(
ci
->
int8_as
)
{
case
SQL_BIGINT
:
CheckDlgButton
(
hdlg
,
DS_INT8_AS_BIGINT
,
1
);
break
;
case
SQL_NUMERIC
:
CheckDlgButton
(
hdlg
,
DS_INT8_AS_NUMERIC
,
1
);
break
;
case
SQL_VARCHAR
:
CheckDlgButton
(
hdlg
,
DS_INT8_AS_VARCHAR
,
1
);
break
;
case
SQL_DOUBLE
:
CheckDlgButton
(
hdlg
,
DS_INT8_AS_DOUBLE
,
1
);
break
;
case
SQL_INTEGER
:
CheckDlgButton
(
hdlg
,
DS_INT8_AS_INT4
,
1
);
break
;
default:
CheckDlgButton
(
hdlg
,
DS_INT8_AS_DEFAULT
,
1
);
}
CheckDlgButton
(
hdlg
,
DS_SHOWOIDCOLUMN
,
atoi
(
ci
->
show_oid_column
));
CheckDlgButton
(
hdlg
,
DS_FAKEOIDINDEX
,
atoi
(
ci
->
fake_oid_index
));
CheckDlgButton
(
hdlg
,
DS_ROWVERSIONING
,
atoi
(
ci
->
row_versioning
));
CheckDlgButton
(
hdlg
,
DS_SHOWSYSTEMTABLES
,
atoi
(
ci
->
show_system_tables
));
CheckDlgButton
(
hdlg
,
DS_DISALLOWPREMATURE
,
ci
->
disallow_premature
);
CheckDlgButton
(
hdlg
,
DS_LFCONVERSION
,
ci
->
lf_conversion
);
CheckDlgButton
(
hdlg
,
DS_TRUEISMINUS1
,
ci
->
true_is_minus1
);
CheckDlgButton
(
hdlg
,
DS_UPDATABLECURSORS
,
ci
->
allow_keyset
);
#ifndef DRIVER_CURSOR_IMPLEMENT
EnableWindow
(
GetDlgItem
(
hdlg
,
DS_UPDATABLECURSORS
),
FALSE
);
#endif
/* DRIVER_CURSOR_IMPLEMENT */
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
(
cmd
=
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
:
case
IDAPPLY
:
case
IDPREVPAGE
:
ci
=
(
ConnInfo
*
)
GetWindowLong
(
hdlg
,
DWL_USER
);
mylog
(
"IDOK: got ci = %u
\n
"
,
ci
);
/* Readonly */
sprintf
(
ci
->
onlyread
,
"%d"
,
IsDlgButtonChecked
(
hdlg
,
DS_READONLY
));
/* Protocol */
if
(
IsDlgButtonChecked
(
hdlg
,
DS_PG62
))
strcpy
(
ci
->
protocol
,
PG62
);
else
if
(
IsDlgButtonChecked
(
hdlg
,
DS_PG63
))
strcpy
(
ci
->
protocol
,
PG63
);
else
/* latest */
strcpy
(
ci
->
protocol
,
PG64
);
/* Int8 As */
if
(
IsDlgButtonChecked
(
hdlg
,
DS_INT8_AS_DEFAULT
))
ci
->
int8_as
=
0
;
else
if
(
IsDlgButtonChecked
(
hdlg
,
DS_INT8_AS_BIGINT
))
ci
->
int8_as
=
SQL_BIGINT
;
else
if
(
IsDlgButtonChecked
(
hdlg
,
DS_INT8_AS_NUMERIC
))
ci
->
int8_as
=
SQL_NUMERIC
;
else
if
(
IsDlgButtonChecked
(
hdlg
,
DS_INT8_AS_DOUBLE
))
ci
->
int8_as
=
SQL_DOUBLE
;
else
if
(
IsDlgButtonChecked
(
hdlg
,
DS_INT8_AS_INT4
))
ci
->
int8_as
=
SQL_INTEGER
;
else
ci
->
int8_as
=
SQL_VARCHAR
;
sprintf
(
ci
->
show_system_tables
,
"%d"
,
IsDlgButtonChecked
(
hdlg
,
DS_SHOWSYSTEMTABLES
));
sprintf
(
ci
->
row_versioning
,
"%d"
,
IsDlgButtonChecked
(
hdlg
,
DS_ROWVERSIONING
));
ci
->
disallow_premature
=
IsDlgButtonChecked
(
hdlg
,
DS_DISALLOWPREMATURE
);
ci
->
lf_conversion
=
IsDlgButtonChecked
(
hdlg
,
DS_LFCONVERSION
);
ci
->
true_is_minus1
=
IsDlgButtonChecked
(
hdlg
,
DS_TRUEISMINUS1
);
#ifdef DRIVER_CURSOR_IMPLEMENT
ci
->
allow_keyset
=
IsDlgButtonChecked
(
hdlg
,
DS_UPDATABLECURSORS
);
#endif
/* DRIVER_CURSOR_IMPLEMENT */
/* 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
));
if
(
IDAPPLY
==
cmd
)
{
SendMessage
(
GetWindow
(
hdlg
,
GW_OWNER
),
WM_COMMAND
,
wParam
,
lParam
);
break
;
}
EndDialog
(
hdlg
,
cmd
==
IDOK
);
if
(
IDOK
==
cmd
)
return
TRUE
;
DialogBoxParam
(
s_hModule
,
MAKEINTRESOURCE
(
DLG_OPTIONS_DRV
),
hdlg
,
ds_options1Proc
,
(
LPARAM
)
ci
);
break
;
case
IDCANCEL
:
EndDialog
(
hdlg
,
GET_WM_COMMAND_ID
(
wParam
,
lParam
)
==
IDOK
);
return
TRUE
;
}
}
return
FALSE
;
}
#endif
/* WIN32 */
src/interfaces/odbc/drvconn.c
View file @
89d6f680
...
...
@@ -293,6 +293,7 @@ dconn_FDriverConnectProc(
ShowWindow
(
GetDlgItem
(
hdlg
,
IDC_DSNAME
),
SW_HIDE
);
ShowWindow
(
GetDlgItem
(
hdlg
,
IDC_DESCTEXT
),
SW_HIDE
);
ShowWindow
(
GetDlgItem
(
hdlg
,
IDC_DESC
),
SW_HIDE
);
ShowWindow
(
GetDlgItem
(
hdlg
,
IDC_DRIVER
),
SW_HIDE
);
SetWindowLong
(
hdlg
,
DWL_USER
,
lParam
);
/* Save the ConnInfo for
* the "OK" */
...
...
@@ -322,16 +323,16 @@ dconn_FDriverConnectProc(
EndDialog
(
hdlg
,
GET_WM_COMMAND_ID
(
wParam
,
lParam
)
==
IDOK
);
return
TRUE
;
case
IDC_D
RIVER
:
case
IDC_D
ATASOURCE
:
ci
=
(
ConnInfo
*
)
GetWindowLong
(
hdlg
,
DWL_USER
);
DialogBoxParam
(
s_hModule
,
MAKEINTRESOURCE
(
DLG_OPTIONS_DRV
),
hdlg
,
d
river_options
Proc
,
(
LPARAM
)
ci
);
hdlg
,
d
s_options1
Proc
,
(
LPARAM
)
ci
);
break
;
case
IDC_D
ATASOURCE
:
case
IDC_D
RIVER
:
ci
=
(
ConnInfo
*
)
GetWindowLong
(
hdlg
,
DWL_USER
);
DialogBoxParam
(
s_hModule
,
MAKEINTRESOURCE
(
DLG_OPTIONS_D
S
),
hdlg
,
d
s
_optionsProc
,
(
LPARAM
)
ci
);
DialogBoxParam
(
s_hModule
,
MAKEINTRESOURCE
(
DLG_OPTIONS_D
RV
),
hdlg
,
d
river
_optionsProc
,
(
LPARAM
)
ci
);
break
;
}
}
...
...
src/interfaces/odbc/info.c
View file @
89d6f680
...
...
@@ -1231,7 +1231,7 @@ PGAPI_Tables(
}
if
(
conn
->
schema_support
)
schema_strcat
(
tables_query
,
" and nspname like '%.*s'"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
);
schema_strcat
(
tables_query
,
" and nspname like '%.*s'"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
,
conn
);
else
my_strcat
(
tables_query
,
" and usename like '%.*s'"
,
szTableOwner
,
cbTableOwner
);
my_strcat
(
tables_query
,
" and relname like '%.*s'"
,
szTableName
,
cbTableName
);
...
...
@@ -1627,7 +1627,7 @@ PGAPI_Columns(
{
my_strcat
(
columns_query
,
" and c.relname = '%.*s'"
,
szTableName
,
cbTableName
);
if
(
conn
->
schema_support
)
schema_strcat
(
columns_query
,
" and u.nspname = '%.*s'"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
);
schema_strcat
(
columns_query
,
" and u.nspname = '%.*s'"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
,
conn
);
else
my_strcat
(
columns_query
,
" and u.usename = '%.*s'"
,
szTableOwner
,
cbTableOwner
);
my_strcat
(
columns_query
,
" and a.attname = '%.*s'"
,
szColumnName
,
cbColumnName
);
...
...
@@ -1640,7 +1640,7 @@ PGAPI_Columns(
escTbnamelen
=
reallyEscapeCatalogEscapes
(
szTableName
,
cbTableName
,
esc_table_name
,
sizeof
(
esc_table_name
),
conn
->
ccsc
);
my_strcat
(
columns_query
,
" and c.relname like '%.*s'"
,
esc_table_name
,
escTbnamelen
);
if
(
conn
->
schema_support
)
schema_strcat
(
columns_query
,
" and u.nspname like '%.*s'"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
);
schema_strcat
(
columns_query
,
" and u.nspname like '%.*s'"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
,
conn
);
else
my_strcat
(
columns_query
,
" and u.usename like '%.*s'"
,
szTableOwner
,
cbTableOwner
);
my_strcat
(
columns_query
,
" and a.attname like '%.*s'"
,
szColumnName
,
cbColumnName
);
...
...
@@ -2130,7 +2130,7 @@ PGAPI_SpecialColumns(
my_strcat
(
columns_query
,
" and c.relname = '%.*s'"
,
szTableName
,
cbTableName
);
/* SchemaName cannot contain a string search pattern */
if
(
conn
->
schema_support
)
schema_strcat
(
columns_query
,
" and u.nspname = '%.*s'"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
);
schema_strcat
(
columns_query
,
" and u.nspname = '%.*s'"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
,
conn
);
else
my_strcat
(
columns_query
,
" and u.usename = '%.*s'"
,
szTableOwner
,
cbTableOwner
);
...
...
@@ -2377,7 +2377,7 @@ PGAPI_Statistics(
}
table_qualifier
[
0
]
=
'\0'
;
if
(
conn
->
schema_support
)
schema_strcat
(
table_qualifier
,
"%.*s"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
);
schema_strcat
(
table_qualifier
,
"%.*s"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
,
conn
);
/*
* we need to get a list of the field names first, so we can return
...
...
@@ -2843,7 +2843,7 @@ PGAPI_PrimaryKeys(
}
pkscm
[
0
]
=
'\0'
;
if
(
conn
->
schema_support
)
schema_strcat
(
pkscm
,
"%.*s"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
);
schema_strcat
(
pkscm
,
"%.*s"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
,
conn
);
result
=
PGAPI_BindCol
(
htbl_stmt
,
1
,
SQL_C_CHAR
,
attname
,
MAX_INFO_STRING
,
&
attname_len
);
...
...
@@ -3379,7 +3379,7 @@ char schema_fetched[MAX_SCHEMA_LEN + 1];
mylog
(
"%s: entering Foreign Key Case #2"
,
func
);
if
(
conn
->
schema_support
)
{
schema_strcat
(
schema_needed
,
"%.*s"
,
szFkTableOwner
,
cbFkTableOwner
,
szFkTableName
,
cbFkTableName
);
schema_strcat
(
schema_needed
,
"%.*s"
,
szFkTableOwner
,
cbFkTableOwner
,
szFkTableName
,
cbFkTableName
,
conn
);
sprintf
(
tables_query
,
"SELECT pt.tgargs, "
" pt.tgnargs, "
" pt.tgdeferrable, "
...
...
@@ -3781,7 +3781,7 @@ if (conn->schema_support)
{
if
(
conn
->
schema_support
)
{
schema_strcat
(
schema_needed
,
"%.*s"
,
szPkTableOwner
,
cbPkTableOwner
,
szPkTableName
,
cbPkTableName
);
schema_strcat
(
schema_needed
,
"%.*s"
,
szPkTableOwner
,
cbPkTableOwner
,
szPkTableName
,
cbPkTableName
,
conn
);
sprintf
(
tables_query
,
"SELECT pt.tgargs, "
" pt.tgnargs, "
" pt.tgdeferrable, "
...
...
@@ -4191,7 +4191,7 @@ PGAPI_Procedures(
if
(
conn
->
schema_support
)
{
strcat
(
proc_query
,
" where pg_proc.pronamespace = pg_namespace.oid"
);
schema_strcat
(
proc_query
,
" and nspname like '%.*s'"
,
szProcOwner
,
cbProcOwner
,
szProcName
,
cbProcName
);
schema_strcat
(
proc_query
,
" and nspname like '%.*s'"
,
szProcOwner
,
cbProcOwner
,
szProcName
,
cbProcName
,
conn
);
my_strcat
(
proc_query
,
" and proname like '%.*s'"
,
szProcName
,
cbProcName
);
}
else
...
...
@@ -4330,7 +4330,7 @@ PGAPI_TablePrivileges(
{
if
(
conn
->
schema_support
)
{
schema_strcat
(
proc_query
,
" nspname = '%.*s' and"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
);
schema_strcat
(
proc_query
,
" nspname = '%.*s' and"
,
szTableOwner
,
cbTableOwner
,
szTableName
,
cbTableName
,
conn
);
}
my_strcat
(
proc_query
,
" relname = '%.*s' and"
,
szTableName
,
cbTableName
);
}
...
...
@@ -4342,7 +4342,7 @@ PGAPI_TablePrivileges(
if
(
conn
->
schema_support
)
{
escTbnamelen
=
reallyEscapeCatalogEscapes
(
szTableOwner
,
cbTableOwner
,
esc_table_name
,
sizeof
(
esc_table_name
),
conn
->
ccsc
);
schema_strcat
(
proc_query
,
" nspname like '%.*s' and"
,
esc_table_name
,
escTbnamelen
,
szTableName
,
cbTableName
);
schema_strcat
(
proc_query
,
" nspname like '%.*s' and"
,
esc_table_name
,
escTbnamelen
,
szTableName
,
cbTableName
,
conn
);
}
escTbnamelen
=
reallyEscapeCatalogEscapes
(
szTableName
,
cbTableName
,
esc_table_name
,
sizeof
(
esc_table_name
),
conn
->
ccsc
);
my_strcat
(
proc_query
,
" relname like '%.*s' and"
,
esc_table_name
,
escTbnamelen
);
...
...
src/interfaces/odbc/info30.c
View file @
89d6f680
...
...
@@ -46,13 +46,13 @@ PGAPI_GetInfo30(HDBC hdbc, UWORD fInfoType, PTR rgbInfoValue,
break
;
case
SQL_KEYSET_CURSOR_ATTRIBUTES1
:
len
=
4
;
value
=
0
;
if
(
ci
->
updatable_cursors
||
ci
->
drivers
.
lie
)
value
|=
(
SQL_CA1_NEXT
|
SQL_CA1_ABSOLUTE
value
=
SQL_CA1_NEXT
|
SQL_CA1_ABSOLUTE
|
SQL_CA1_RELATIVE
|
SQL_CA1_BOOKMARK
|
SQL_CA1_LOCK_NO_CHANGE
|
SQL_CA1_POS_POSITION
|
SQL_CA1_POS_UPDATE
|
SQL_CA1_POS_DELETE
|
SQL_CA1_POS_REFRESH
|
SQL_CA1_BULK_ADD
|
SQL_CA1_POS_REFRESH
;
if
(
ci
->
updatable_cursors
||
ci
->
drivers
.
lie
)
value
|=
(
SQL_CA1_POS_UPDATE
|
SQL_CA1_POS_DELETE
|
SQL_CA1_BULK_ADD
|
SQL_CA1_BULK_UPDATE_BY_BOOKMARK
|
SQL_CA1_BULK_DELETE_BY_BOOKMARK
|
SQL_CA1_BULK_FETCH_BY_BOOKMARK
...
...
@@ -67,7 +67,7 @@ PGAPI_GetInfo30(HDBC hdbc, UWORD fInfoType, PTR rgbInfoValue,
break
;
case
SQL_KEYSET_CURSOR_ATTRIBUTES2
:
len
=
4
;
value
=
0
;
value
=
SQL_CA2_READ_ONLY_CONCURRENCY
;
if
(
ci
->
updatable_cursors
||
ci
->
drivers
.
lie
)
value
|=
(
SQL_CA2_OPT_ROWVER_CONCURRENCY
/*| SQL_CA2_CRC_APPROXIMATE*/
...
...
src/interfaces/odbc/misc.c
View file @
89d6f680
...
...
@@ -28,6 +28,7 @@
#include <process.h>
/* Byron: is this where Windows keeps def.
* of getpid ? */
#endif
#include "connection.h"
extern
GLOBAL_VALUES
globals
;
void
generate_filename
(
const
char
*
,
const
char
*
,
char
*
);
...
...
@@ -280,17 +281,17 @@ my_strcat(char *buf, const char *fmt, const char *s, int len)
}
char
*
schema_strcat
(
char
*
buf
,
const
char
*
fmt
,
const
char
*
s
,
int
len
,
const
char
*
tbname
,
int
tbnmlen
)
schema_strcat
(
char
*
buf
,
const
char
*
fmt
,
const
char
*
s
,
int
len
,
const
char
*
tbname
,
int
tbnmlen
,
ConnectionClass
*
conn
)
{
if
(
!
s
||
0
==
len
)
{
/*
*
I can find no appropriate way to find
*
the CURRENT SCHEMA. If you are lucky
*
you can get expected result
.
*
Note that this driver assumes the implicit schema is
*
the CURRENT_SCHEMA() though it doesn't worth the
*
naming
.
*/
/***** if (
tbname && (tbnmlen > 0 || tbnmlen == SQL_NTS))
return my_strcat(buf, fmt,
"public", 6); *****/
if
(
conn
->
schema_support
&&
tbname
&&
(
tbnmlen
>
0
||
tbnmlen
==
SQL_NTS
))
return
my_strcat
(
buf
,
fmt
,
CC_get_current_schema
(
conn
),
SQL_NTS
);
return
NULL
;
}
return
my_strcat
(
buf
,
fmt
,
s
,
len
);
...
...
src/interfaces/odbc/misc.h
View file @
89d6f680
...
...
@@ -92,7 +92,7 @@ char *trim(char *string);
char
*
make_string
(
const
char
*
s
,
int
len
,
char
*
buf
);
char
*
my_strcat
(
char
*
buf
,
const
char
*
fmt
,
const
char
*
s
,
int
len
);
char
*
schema_strcat
(
char
*
buf
,
const
char
*
fmt
,
const
char
*
s
,
int
len
,
const
char
*
,
int
);
const
char
*
,
int
,
ConnectionClass
*
conn
);
/* #define GET_SCHEMA_NAME(nspname) (stricmp(nspname, "public") ? nspname : "") */
#define GET_SCHEMA_NAME(nspname) (nspname)
...
...
src/interfaces/odbc/multibyte.c
View file @
89d6f680
...
...
@@ -351,6 +351,44 @@ CC_lookup_characterset(ConnectionClass *self)
encstr
=
CC_lookup_cs_new
(
self
);
if
(
self
->
client_encoding
)
free
(
self
->
client_encoding
);
#ifndef UNICODE_SUPPORT
#ifdef WIN32
else
{
const
char
*
wenc
=
NULL
;
switch
(
GetACP
())
{
case
932
:
wenc
=
"SJIS"
;
break
;
case
936
:
wenc
=
"GBK"
;
break
;
case
949
:
wenc
=
"UHC"
;
break
;
case
950
:
wenc
=
"BIG5"
;
break
;
}
if
(
wenc
&&
stricmp
(
encstr
,
wenc
))
{
QResultClass
*
res
;
char
query
[
64
];
sprintf
(
query
,
"set client_encoding to '%s'"
,
wenc
);
res
=
CC_send_query
(
self
,
query
,
NULL
,
CLEAR_RESULT_ON_ABORT
);
if
(
res
)
{
self
->
client_encoding
=
strdup
(
wenc
);
QR_Destructor
(
res
);
free
(
encstr
);
return
;
}
}
}
#endif
/* WIN32 */
#endif
/* UNICODE_SUPPORT */
if
(
encstr
)
{
self
->
client_encoding
=
encstr
;
...
...
src/interfaces/odbc/parse.c
View file @
89d6f680
...
...
@@ -597,10 +597,8 @@ parse_statement(StatementClass *stmt)
if
(
fi
[
ifld
]
->
dot
[
0
])
{
strcat
(
fi
[
ifld
]
->
dot
,
"."
);
strcat
(
fi
[
ifld
]
->
dot
,
fi
[
ifld
]
->
name
);
fi
[
ifld
]
->
schema
=
strdup
(
fi
[
ifld
]
->
dot
);
}
else
strcpy
(
fi
[
ifld
]
->
dot
,
fi
[
ifld
]
->
name
);
strcpy
(
fi
[
ifld
]
->
name
,
token
);
...
...
@@ -820,17 +818,49 @@ parse_statement(StatementClass *stmt)
fi
[
i
]
->
length
=
fi
[
i
]
->
column_size
;
continue
;
}
/* field name contains the schema name */
else
if
(
fi
[
i
]
->
schema
)
{
int
matchidx
=
-
1
;
for
(
k
=
0
;
k
<
stmt
->
ntab
;
k
++
)
{
if
(
!
stricmp
(
ti
[
k
]
->
name
,
fi
[
i
]
->
dot
))
{
if
(
!
stricmp
(
ti
[
k
]
->
schema
,
fi
[
i
]
->
schema
))
{
fi
[
i
]
->
ti
=
ti
[
k
];
break
;
}
else
if
(
!
ti
[
k
]
->
schema
[
0
])
{
if
(
matchidx
<
0
)
matchidx
=
k
;
else
{
stmt
->
parse_status
=
STMT_PARSE_FATAL
;
stmt
->
errornumber
=
STMT_EXEC_ERROR
;
stmt
->
errormsg
=
"duplicated Table name"
;
stmt
->
updatable
=
FALSE
;
return
FALSE
;
}
}
}
}
if
(
matchidx
>=
0
)
fi
[
i
]
->
ti
=
ti
[
matchidx
];
}
/* it's a dot, resolve to table or alias */
else
if
(
fi
[
i
]
->
dot
[
0
])
{
for
(
k
=
0
;
k
<
stmt
->
ntab
;
k
++
)
{
if
(
!
stricmp
(
ti
[
k
]
->
name
,
fi
[
i
]
->
dot
))
if
(
!
stricmp
(
ti
[
k
]
->
alias
,
fi
[
i
]
->
dot
))
{
fi
[
i
]
->
ti
=
ti
[
k
];
break
;
}
else
if
(
!
stricmp
(
ti
[
k
]
->
alias
,
fi
[
i
]
->
dot
))
else
if
(
!
stricmp
(
ti
[
k
]
->
name
,
fi
[
i
]
->
dot
))
{
fi
[
i
]
->
ti
=
ti
[
k
];
break
;
...
...
@@ -869,39 +899,35 @@ parse_statement(StatementClass *stmt)
/* See if already got it */
char
found
=
FALSE
;
if
(
conn
->
schema_support
)
{
if
(
!
ti
[
i
]
->
schema
[
0
])
{
const
char
*
curschema
=
CC_get_current_schema
(
conn
);
/*
* Though current_schema() doesn't have
* much sense in PostgreSQL, we first
* check the current_schema() when no
* explicit schema name was specified.
*/
for
(
k
=
0
;
k
<
conn
->
ntables
;
k
++
)
{
if
(
!
stricmp
(
conn
->
col_info
[
k
]
->
name
,
ti
[
i
]
->
name
))
if
(
!
stricmp
(
conn
->
col_info
[
k
]
->
name
,
ti
[
i
]
->
name
)
&&
!
stricmp
(
conn
->
col_info
[
k
]
->
schema
,
curschema
))
{
mylog
(
"FOUND col_info table='%s'
\n
"
,
ti
[
i
]
->
name
);
mylog
(
"FOUND col_info table='%s' current schema='%s'
\n
"
,
ti
[
i
]
->
name
,
curschema
);
found
=
TRUE
;
strcpy
(
ti
[
i
]
->
schema
,
curschema
);
break
;
}
}
if
(
!
found
)
{
mylog
(
"PARSE: Getting PG_Columns for table[%d]='%s'
\n
"
,
i
,
ti
[
i
]
->
name
);
result
=
PGAPI_AllocStmt
(
stmt
->
hdbc
,
&
hcol_stmt
);
if
((
result
!=
SQL_SUCCESS
)
&&
(
result
!=
SQL_SUCCESS_WITH_INFO
))
{
stmt
->
errormsg
=
"PGAPI_AllocStmt failed in parse_statement for columns."
;
stmt
->
errornumber
=
STMT_NO_MEMORY_ERROR
;
stmt
->
parse_status
=
STMT_PARSE_FATAL
;
return
FALSE
;
}
col_stmt
=
(
StatementClass
*
)
hcol_stmt
;
col_stmt
->
internal
=
TRUE
;
if
(
!
ti
[
i
]
->
schema
[
0
]
&&
conn
->
schema_support
)
{
QResultClass
*
res
;
BOOL
tblFound
=
FALSE
;
/* Unfortunately CURRENT_SCHEMA doesn't exist
* in PostgreSQL and we
have to check as follows.
/*
* We also
have to check as follows.
*/
sprintf
(
token
,
"select nspname from pg_namespace n, pg_class c"
" where c.relnamespace=n.oid and c.oid='%s'::regclass"
,
ti
[
i
]
->
name
);
...
...
@@ -926,6 +952,50 @@ parse_statement(StatementClass *stmt)
return
FALSE
;
}
}
}
if
(
!
found
&&
ti
[
i
]
->
schema
[
0
])
{
for
(
k
=
0
;
k
<
conn
->
ntables
;
k
++
)
{
if
(
!
stricmp
(
conn
->
col_info
[
k
]
->
name
,
ti
[
i
]
->
name
)
&&
!
stricmp
(
conn
->
col_info
[
k
]
->
schema
,
ti
[
i
]
->
schema
))
{
mylog
(
"FOUND col_info table='%s' schema='%s'
\n
"
,
ti
[
i
]
->
name
,
ti
[
i
]
->
schema
);
found
=
TRUE
;
break
;
}
}
}
}
else
{
for
(
k
=
0
;
k
<
conn
->
ntables
;
k
++
)
{
if
(
!
stricmp
(
conn
->
col_info
[
k
]
->
name
,
ti
[
i
]
->
name
))
{
mylog
(
"FOUND col_info table='%s'
\n
"
,
ti
[
i
]
->
name
);
found
=
TRUE
;
break
;
}
}
}
if
(
!
found
)
{
mylog
(
"PARSE: Getting PG_Columns for table[%d]='%s'
\n
"
,
i
,
ti
[
i
]
->
name
);
result
=
PGAPI_AllocStmt
(
stmt
->
hdbc
,
&
hcol_stmt
);
if
((
result
!=
SQL_SUCCESS
)
&&
(
result
!=
SQL_SUCCESS_WITH_INFO
))
{
stmt
->
errormsg
=
"PGAPI_AllocStmt failed in parse_statement for columns."
;
stmt
->
errornumber
=
STMT_NO_MEMORY_ERROR
;
stmt
->
parse_status
=
STMT_PARSE_FATAL
;
return
FALSE
;
}
col_stmt
=
(
StatementClass
*
)
hcol_stmt
;
col_stmt
->
internal
=
TRUE
;
result
=
PGAPI_Columns
(
hcol_stmt
,
""
,
0
,
ti
[
i
]
->
schema
,
SQL_NTS
,
ti
[
i
]
->
name
,
SQL_NTS
,
""
,
0
,
PODBC_NOT_SEARCH_PATTERN
);
...
...
@@ -957,6 +1027,10 @@ parse_statement(StatementClass *stmt)
* Store the table name and the SQLColumns result
* structure
*/
if
(
ti
[
i
]
->
schema
[
0
])
conn
->
col_info
[
conn
->
ntables
]
->
schema
=
strdup
(
ti
[
i
]
->
schema
);
else
conn
->
col_info
[
conn
->
ntables
]
->
schema
=
NULL
;
strcpy
(
conn
->
col_info
[
conn
->
ntables
]
->
name
,
ti
[
i
]
->
name
);
conn
->
col_info
[
conn
->
ntables
]
->
result
=
SC_get_Curres
(
col_stmt
);
...
...
src/interfaces/odbc/pgtypes.c
View file @
89d6f680
...
...
@@ -287,6 +287,8 @@ pgtype_to_concise_type(StatementClass *stmt, Int4 type)
/* Change this to SQL_BIGINT for ODBC v3 bjm 2001-01-23 */
case
PG_TYPE_INT8
:
if
(
ci
->
int8_as
!=
0
)
return
ci
->
int8_as
;
if
(
conn
->
ms_jet
)
return
SQL_NUMERIC
;
/* maybe a little better than SQL_VARCHAR */
#if (ODBCVER >= 0x0300)
...
...
@@ -625,7 +627,8 @@ getCharColumnSize(StatementClass *stmt, Int4 type, int col, int handle_unknown_s
maxsize
;
QResultClass
*
result
;
ColumnInfoClass
*
flds
;
ConnInfo
*
ci
=
&
(
SC_get_conn
(
stmt
)
->
connInfo
);
ConnectionClass
*
conn
=
SC_get_conn
(
stmt
);
ConnInfo
*
ci
=
&
(
conn
->
connInfo
);
mylog
(
"getCharColumnSize: type=%d, col=%d, unknown = %d
\n
"
,
type
,
col
,
handle_unknown_size_as
);
...
...
@@ -684,8 +687,24 @@ getCharColumnSize(StatementClass *stmt, Int4 type, int col, int handle_unknown_s
p
=
QR_get_display_size
(
result
,
col
);
/* longest */
attlen
=
QR_get_atttypmod
(
result
,
col
);
/* Size is unknown -- handle according to parameter */
if
(
attlen
>=
p
&&
attlen
>
0
)
/* maybe the length is known */
if
(
attlen
>
0
)
/* maybe the length is known */
{
if
(
attlen
>=
p
)
return
attlen
;
switch
(
type
)
{
case
PG_TYPE_VARCHAR
:
case
PG_TYPE_BPCHAR
:
if
(
conn
->
unicode
||
conn
->
ms_jet
)
return
attlen
;
#if (ODBCVER >= 0x0300)
#ifdef MULTIBYTE
return
attlen
;
#endif
/* MULTIBYTE */
#endif
/* ODBCVER */
return
p
;
}
}
/* The type is really unknown */
if
(
type
==
PG_TYPE_BPCHAR
||
handle_unknown_size_as
==
UNKNOWNS_AS_LONGEST
)
...
...
src/interfaces/odbc/psqlodbc.h
View file @
89d6f680
...
...
@@ -5,7 +5,7 @@
*
* Comments: See "notice.txt" for copyright and license information.
*
* $Id: psqlodbc.h,v 1.6
6 2002/05/22 05:51:03
inoue Exp $
* $Id: psqlodbc.h,v 1.6
7 2002/06/06 04:50:47
inoue Exp $
*
*/
...
...
src/interfaces/odbc/psqlodbc.rc
View file @
89d6f680
...
...
@@ -78,8 +78,8 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,81,88,40,14
GROUPBOX "Options (Advanced):",IDC_OPTIONS,141,72,140,35,
BS_CENTER
PUSHBUTTON "D
river",IDC_DRIVER
,149,89,50,14
PUSHBUTTON "D
ataSource",IDC_DATASOURCE
,221,88,50,14
PUSHBUTTON "D
ataSource",IDC_DATASOURCE
,149,89,50,14
PUSHBUTTON "D
efault",IDC_DRIVER
,221,88,50,14
CTEXT "Please supply any missing information needed to connect.",
DRV_MSG_LABEL,25,4,238,10
END
...
...
@@ -89,92 +89,111 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Advanced Options (Driver)"
FONT 10, "Terminal"
BEGIN
PUSHBUTTON "Page 1",IDPREVPAGE,10,1,40,15
PUSHBUTTON "Page 2",IDNEXTPAGE,50,1,40,15
CTEXT "Set your site's defaults (for new DSNs).",
DRV_MSG_LABEL2,15,1,270,10, SS_CENTER | WS_GROUP, WS_EX_STATICEDGE
CONTROL "Disable Genetic &Optimizer",DRV_OPTIMIZER,"Button",
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,13,1
1
,116,10
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,13,1
8
,116,10
CONTROL "Comm&Log (C:\\psqlodbc.log)",DRV_COMMLOG,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,164,1
1
,120,10
BS_AUTOCHECKBOX | WS_TABSTOP,164,1
8
,120,10
CONTROL "&KSQO (Keyset Query Optimization)",DRV_KSQO,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,13,
23
,144,10
BS_AUTOCHECKBOX | WS_TABSTOP,13,
30
,144,10
CONTROL "&ReadOnly (Default)",DRV_READONLY,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,164,
24
,88,10
BS_AUTOCHECKBOX | WS_TABSTOP,164,
31
,88,10
CONTROL "Recognize Unique &Indexes",DRV_UNIQUEINDEX,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,13,
35
,112,10
BS_AUTOCHECKBOX | WS_TABSTOP,13,
42
,112,10
CONTROL "P&arse Statements",DRV_PARSE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,164,
37
,80,10
WS_TABSTOP,164,
44
,80,10
CONTROL "&Use Declare/Fetch",DRV_USEDECLAREFETCH,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,13,
47
,84,10
BS_AUTOCHECKBOX | WS_TABSTOP,13,
54
,84,10
CONTROL "Cancel as FreeStmt (Exp)",DRV_CANCELASFREESTMT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,164,5
0
,112,10
BS_AUTOCHECKBOX | WS_TABSTOP,164,5
7
,112,10
CONTROL "Mylog(Debug ouput)",DRV_DEBUG,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,164,
63
,112,10
GROUPBOX "Unknown Sizes",IDC_STATIC,13,
76
,175,24
BS_AUTOCHECKBOX | WS_TABSTOP,164,
70
,112,10
GROUPBOX "Unknown Sizes",IDC_STATIC,13,
81
,175,24
CONTROL "Maximum",DRV_UNKNOWN_MAX,"Button",BS_AUTORADIOBUTTON |
WS_GROUP | WS_TABSTOP,21,8
4
,44,10
WS_GROUP | WS_TABSTOP,21,8
9
,44,10
CONTROL "Don't Know",DRV_UNKNOWN_DONTKNOW,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,72,8
4
,56,10
BS_AUTORADIOBUTTON | WS_TABSTOP,72,8
9
,56,10
CONTROL "Longest",DRV_UNKNOWN_LONGEST,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,135,8
4
,44,10
GROUPBOX "Data Type Options",IDC_STATIC,13,10
4
,282,23
BS_AUTORADIOBUTTON | WS_TABSTOP,135,8
9
,44,10
GROUPBOX "Data Type Options",IDC_STATIC,13,10
9
,282,23
CONTROL "Text as LongVarChar",DRV_TEXT_LONGVARCHAR,"Button",
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,15,1
15
,92,10
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,15,1
20
,92,10
CONTROL "Unknowns as LongVarChar",DRV_UNKNOWNS_LONGVARCHAR,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,1
15
,108,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,1
20
,108,10
CONTROL "Bools as Char",DRV_BOOLS_CHAR,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,225,1
15
,68,10
LTEXT "&Cache Size:",IDC_STATIC,15,13
3
,45,8
EDITTEXT DRV_CACHE_SIZE,61,1
29
,35,12,ES_AUTOHSCROLL
LTEXT "Max &Varchar:",IDC_STATIC,99,13
3
,49,8
EDITTEXT DRV_VARCHAR_SIZE,149,1
29
,35,12,ES_AUTOHSCROLL
LTEXT "Max Lon&gVarChar:",IDC_STATIC,192,13
3
,65,8
EDITTEXT DRV_LONGVARCHAR_SIZE,259,1
29
,35,12,ES_AUTOHSCROLL
LTEXT "SysTable &Prefixes:",IDC_STATIC,23,14
4
,36,20
EDITTEXT DRV_EXTRASYSTABLEPREFIXES,61,15
3
,75,12,ES_AUTOHSCROLL
LTEXT "Connect &Settings:",IDC_STATIC,22,1
65
,35,20
EDITTEXT DRV_CONNSETTINGS,61,1
65
,225,25,ES_MULTILINE |
WS_TABSTOP,225,1
20
,68,10
LTEXT "&Cache Size:",IDC_STATIC,15,13
8
,45,8
EDITTEXT DRV_CACHE_SIZE,61,1
34
,35,12,ES_AUTOHSCROLL
LTEXT "Max &Varchar:",IDC_STATIC,99,13
8
,49,8
EDITTEXT DRV_VARCHAR_SIZE,149,1
34
,35,12,ES_AUTOHSCROLL
LTEXT "Max Lon&gVarChar:",IDC_STATIC,192,13
8
,65,8
EDITTEXT DRV_LONGVARCHAR_SIZE,259,1
34
,35,12,ES_AUTOHSCROLL
LTEXT "SysTable &Prefixes:",IDC_STATIC,23,14
9
,36,20
EDITTEXT DRV_EXTRASYSTABLEPREFIXES,61,15
8
,75,12,ES_AUTOHSCROLL
LTEXT "Connect &Settings:",IDC_STATIC,22,1
70
,35,20
EDITTEXT DRV_CONNSETTINGS,61,1
70
,225,25,ES_MULTILINE |
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
DEFPUSHBUTTON "OK",IDOK,59,201,50,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,124,201,50,14
PUSHBUTTON "Defaults",IDDEFAULTS,189,201,50,15
CONTROL "Default",DRV_OR_DSN,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT |
BS_NOTIFY | WS_TABSTOP,247,205,40,10
DEFPUSHBUTTON "Close",IDOK,39,201,50,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,104,201,50,15
PUSHBUTTON "Apply",IDAPPLY,169,201,50,14
PUSHBUTTON "Defaults",IDDEFAULTS,234,201,50,15
END
DLG_OPTIONS_DS DIALOG DISCARDABLE 0, 0, 267,
19
6
DLG_OPTIONS_DS DIALOG DISCARDABLE 0, 0, 267,
22
6
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Advanced Options (DataSource)"
FONT 10, "Terminal"
BEGIN
PUSHBUTTON "Page 2",IDNEXTPAGE,50,1,40,15
PUSHBUTTON "Page 1",IDPREVPAGE,10,1,40,15
CONTROL "&ReadOnly",DS_READONLY,"Button",BS_AUTOCHECKBOX |
WS_GROUP | WS_TABSTOP,
45,13
,48,10
WS_GROUP | WS_TABSTOP,
25,18
,48,10
CONTROL "Row &Versioning",DS_ROWVERSIONING,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,1
49,13
,72,10
BS_AUTOCHECKBOX | WS_TABSTOP,1
29,18
,72,10
CONTROL "Show System &Tables",DS_SHOWSYSTEMTABLES,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,
45,28
,88,10
BS_AUTOCHECKBOX | WS_TABSTOP,
25,33
,88,10
CONTROL "Disallow &Premature",DS_DISALLOWPREMATURE,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,1
49,28
,86,10
BS_AUTOCHECKBOX | WS_TABSTOP,1
29,33
,86,10
CONTROL "LF <-> CR/LF convert",DS_LFCONVERSION,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,
45,43
,92,10
BS_AUTOCHECKBOX | WS_TABSTOP,
25,48
,92,10
CONTROL "True is -1",DS_TRUEISMINUS1,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,1
49,43
,86,10
BS_AUTOCHECKBOX | WS_TABSTOP,1
29,48
,86,10
CONTROL "(Trial) Updatable cursors",DS_UPDATABLECURSORS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,45,58,112,10
GROUPBOX "Protocol",IDC_STATIC,43,74,180,25
BS_AUTOCHECKBOX | WS_TABSTOP,25,63,112,10
GROUPBOX "Int8 As",IDC_STATIC,23,79,235,25
CONTROL "default",DS_INT8_AS_DEFAULT,"Button",BS_AUTORADIOBUTTON |
WS_GROUP,30,89,47,10
CONTROL "bigint",DS_INT8_AS_BIGINT,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
70,89,35,10
CONTROL "numeric",DS_INT8_AS_NUMERIC,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
107,89,40,10
CONTROL "varchar",DS_INT8_AS_VARCHAR,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
149,89,40,10
CONTROL "double",DS_INT8_AS_DOUBLE,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
190,89,40,10
CONTROL "int4",DS_INT8_AS_INT4,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
227,89,28,10
GROUPBOX "Protocol",IDC_STATIC,23,109,180,25
CONTROL "7.X,6.4+",DS_PG64,"Button",BS_AUTORADIOBUTTON |
WS_GROUP,
53,84
,47,10
WS_GROUP,
33,119
,47,10
CONTROL "6.3",DS_PG63,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
131,84
,26,10
83,119
,26,10
CONTROL "6.2",DS_PG62,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
1
87,84
,26,10
GROUPBOX "OID Options",IDC_STATIC,
43,104
,180,25
1
33,119
,26,10
GROUPBOX "OID Options",IDC_STATIC,
23,129
,180,25
CONTROL "Show &Column",DS_SHOWOIDCOLUMN,"Button",BS_AUTOCHECKBOX |
WS_GROUP | WS_TABSTOP,
53,115
,59,10
WS_GROUP | WS_TABSTOP,
33,140
,59,10
CONTROL "Fake &Index",DS_FAKEOIDINDEX,"Button",BS_AUTOCHECKBOX |
WS_GROUP | WS_TABSTOP,1
61,115
,55,10
LTEXT "Connect &Settings:",IDC_STATIC,10,1
35
,35,25
EDITTEXT DS_CONNSETTINGS,50,1
35
,200,20,ES_MULTILINE |
WS_GROUP | WS_TABSTOP,1
41,140
,55,10
LTEXT "Connect &Settings:",IDC_STATIC,10,1
70
,35,25
EDITTEXT DS_CONNSETTINGS,50,1
70
,200,20,ES_MULTILINE |
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
DEFPUSHBUTTON "OK",IDOK,71,165,50,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,146,165,50,14
DEFPUSHBUTTON "Close",IDOK,51,195,50,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,126,195,50,14
PUSHBUTTON "Apply",IDAPPLY,201,195,50,14
END
#else
DLG_CONFIG DIALOG DISCARDABLE 65, 43, 292, 116
...
...
@@ -201,103 +220,122 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,80,90,40,14
GROUPBOX "Options (Advanced):",IDC_OPTIONS,140,74,140,35,
BS_CENTER
PUSHBUTTON "D
river",IDC_DRIVER
,160,90,50,14
PUSHBUTTON "D
ataSource",IDC_DATASOURCE
,220,90,50,14
PUSHBUTTON "D
ataSource",IDC_DATASOURCE
,160,90,50,14
PUSHBUTTON "D
efault",IDC_DRIVER
,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, 2
41
DLG_OPTIONS_DRV DIALOG DISCARDABLE 0, 0, 287, 2
50
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Advanced Options (Driver)"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "Page 1",IDPREVPAGE,10,1,40,15
PUSHBUTTON "Page 2",IDNEXTPAGE,50,1,40,15
CTEXT "Set your site's defaults (for new DSNs).",
DRV_MSG_LABEL2,15,1,270,10, SS_CENTER | WS_GROUP, WS_EX_STATICEDGE
CONTROL "Disable Genetic &Optimizer",DRV_OPTIMIZER,"Button",
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,15,
5
,97,10
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,15,
18
,97,10
CONTROL "Comm&Log (C:\\psqlodbc.log)",DRV_COMMLOG,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,140,
5
,113,10
BS_AUTOCHECKBOX | WS_TABSTOP,140,
18
,113,10
CONTROL "&KSQO (Keyset Query Optimization)",DRV_KSQO,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,15,
20
,124,10
BS_AUTOCHECKBOX | WS_TABSTOP,15,
33
,124,10
CONTROL "&ReadOnly (Default)",DRV_READONLY,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,140,
20
,80,10
BS_AUTOCHECKBOX | WS_TABSTOP,140,
33
,80,10
CONTROL "Recognize Unique &Indexes",DRV_UNIQUEINDEX,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,15,
35
,101,10
BS_AUTOCHECKBOX | WS_TABSTOP,15,
48
,101,10
CONTROL "P&arse Statements",DRV_PARSE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,140,
35
,80,10
WS_TABSTOP,140,
48
,80,10
CONTROL "&Use Declare/Fetch",DRV_USEDECLAREFETCH,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,15,
50
,80,10
BS_AUTOCHECKBOX | WS_TABSTOP,15,
63
,80,10
CONTROL "Cancel as FreeStmt (Exp)",DRV_CANCELASFREESTMT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,140,
50
,105,10
BS_AUTOCHECKBOX | WS_TABSTOP,140,
63
,105,10
CONTROL "Mylog(Debug ouput)",DRV_DEBUG,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,140,
65
,112,10
GROUPBOX "Unknown Sizes",IDC_STATIC,10,
80
,175,25
BS_AUTOCHECKBOX | WS_TABSTOP,140,
78
,112,10
GROUPBOX "Unknown Sizes",IDC_STATIC,10,
93
,175,25
CONTROL "Maximum",DRV_UNKNOWN_MAX,"Button",BS_AUTORADIOBUTTON |
WS_GROUP | WS_TABSTOP,15,
91
,45,10
WS_GROUP | WS_TABSTOP,15,
104
,45,10
CONTROL "Don't Know",DRV_UNKNOWN_DONTKNOW,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,70,
91
,53,10
BS_AUTORADIOBUTTON | WS_TABSTOP,70,
104
,53,10
CONTROL "Longest",DRV_UNKNOWN_LONGEST,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,130,
91
,50,10
GROUPBOX "Data Type Options",IDC_STATIC,10,1
10
,270,25
BS_AUTORADIOBUTTON | WS_TABSTOP,130,
104
,50,10
GROUPBOX "Data Type Options",IDC_STATIC,10,1
23
,270,25
CONTROL "Text as LongVarChar",DRV_TEXT_LONGVARCHAR,"Button",
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,15,1
20
,80,10
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,15,1
33
,80,10
CONTROL "Unknowns as LongVarChar",DRV_UNKNOWNS_LONGVARCHAR,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,105,1
20
,100,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,105,1
33
,100,10
CONTROL "Bools as Char",DRV_BOOLS_CHAR,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,215,1
20
,60,10
LTEXT "&Cache Size:",IDC_STATIC,10,14
5
,40,10
EDITTEXT DRV_CACHE_SIZE,50,1
45
,35,12,ES_AUTOHSCROLL
LTEXT "Max &Varchar:",IDC_STATIC,90,14
5
,45,10
EDITTEXT DRV_VARCHAR_SIZE,135,1
45
,35,12,ES_AUTOHSCROLL
LTEXT "Max Lon&gVarChar:",IDC_STATIC,180,14
5
,60,10
EDITTEXT DRV_LONGVARCHAR_SIZE,240,1
45
,35,12,ES_AUTOHSCROLL
LTEXT "SysTable &Prefixes:",IDC_STATIC,15,1
60
,35,20
EDITTEXT DRV_EXTRASYSTABLEPREFIXES,50,1
66
,75,12,ES_AUTOHSCROLL
RTEXT "Connect &Settings:",IDC_STATIC,10,18
5
,35,20
EDITTEXT DRV_CONNSETTINGS,50,1
85
,225,25,ES_MULTILINE |
WS_TABSTOP,215,1
33
,60,10
LTEXT "&Cache Size:",IDC_STATIC,10,14
8
,40,10
EDITTEXT DRV_CACHE_SIZE,50,1
53
,35,12,ES_AUTOHSCROLL
LTEXT "Max &Varchar:",IDC_STATIC,90,14
0
,45,10
EDITTEXT DRV_VARCHAR_SIZE,135,1
53
,35,12,ES_AUTOHSCROLL
LTEXT "Max Lon&gVarChar:",IDC_STATIC,180,14
0
,60,10
EDITTEXT DRV_LONGVARCHAR_SIZE,240,1
53
,35,12,ES_AUTOHSCROLL
LTEXT "SysTable &Prefixes:",IDC_STATIC,15,1
55
,35,20
EDITTEXT DRV_EXTRASYSTABLEPREFIXES,50,1
74
,75,12,ES_AUTOHSCROLL
RTEXT "Connect &Settings:",IDC_STATIC,10,18
0
,35,20
EDITTEXT DRV_CONNSETTINGS,50,1
93
,225,25,ES_MULTILINE |
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
DEFPUSHBUTTON "OK",IDOK,45,220,50,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,110,220,50,14
PUSHBUTTON "Defaults",IDDEFAULTS,175,220,50,15
CONTROL "Default",DRV_OR_DSN,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT |
BS_NOTIFY | WS_TABSTOP,233,224,40,10
DEFPUSHBUTTON "Close",IDOK,25,228,50,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,90,228,50,15
PUSHBUTTON "Apply",IDAPPLY,155,228,50,14
PUSHBUTTON "Defaults",IDDEFAULTS,220,228,50,15
END
DLG_OPTIONS_DS DIALOG DISCARDABLE 0, 0, 267,
18
6
DLG_OPTIONS_DS DIALOG DISCARDABLE 0, 0, 267,
21
6
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Advanced Options (DataSource)"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "Page 2",IDNEXTPAGE,50,1,40,15
PUSHBUTTON "Page 1",IDPREVPAGE,10,1,40,15
CONTROL "&ReadOnly",DS_READONLY,"Button",BS_AUTOCHECKBOX |
WS_GROUP | WS_TABSTOP,25,1
0
,53,10
WS_GROUP | WS_TABSTOP,25,1
8
,53,10
CONTROL "Row &Versioning",DS_ROWVERSIONING,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,130,1
0
,85,10
BS_AUTOCHECKBOX | WS_TABSTOP,130,1
8
,85,10
CONTROL "Show System &Tables",DS_SHOWSYSTEMTABLES,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,25,
25
,85,10
BS_AUTOCHECKBOX | WS_TABSTOP,25,
33
,85,10
CONTROL "Disallow &Premature",DS_DISALLOWPREMATURE,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,130,
25
,85,10
BS_AUTOCHECKBOX | WS_TABSTOP,130,
33
,85,10
CONTROL "LF <-> CR/LF convert",DS_LFCONVERSION,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,25,4
0
,92,10
BS_AUTOCHECKBOX | WS_TABSTOP,25,4
8
,92,10
CONTROL "True is -1",DS_TRUEISMINUS1,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,130,4
0
,86,10
BS_AUTOCHECKBOX | WS_TABSTOP,130,4
8
,86,10
CONTROL "(Trial) Updatable Cursors",DS_UPDATABLECURSORS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,25,55,102,10
GROUPBOX "Protocol",IDC_STATIC,15,70,180,25
BS_AUTOCHECKBOX | WS_TABSTOP,25,63,102,10
GROUPBOX "Int8 As",IDC_STATIC,15,78,248,25
CONTROL "default",DS_INT8_AS_DEFAULT,"Button",BS_AUTORADIOBUTTON | WS_GROUP,20,
88,35,10
CONTROL "bigint",DS_INT8_AS_BIGINT,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
63,88,35,10
CONTROL "numeric",DS_INT8_AS_NUMERIC,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
106,88,40,10
CONTROL "varchar",DS_INT8_AS_VARCHAR,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
149,88,40,10
CONTROL "double",DS_INT8_AS_DOUBLE,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
192,88,40,10
CONTROL "int4",DS_INT8_AS_INT4,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
235,88,25,10
GROUPBOX "Protocol",IDC_STATIC,15,109,180,25
CONTROL "7.X,6.4+",DS_PG64,"Button",BS_AUTORADIOBUTTON | WS_GROUP,25,
80
,35,10
118
,35,10
CONTROL "6.3",DS_PG63,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
75,
80
,26,10
75,
118
,26,10
CONTROL "6.2",DS_PG62,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
130,
80
,26,10
GROUPBOX "OID Options",IDC_STATIC,15,1
01
,180,25
130,
118
,26,10
GROUPBOX "OID Options",IDC_STATIC,15,1
40
,180,25
CONTROL "Show &Column",DS_SHOWOIDCOLUMN,"Button",BS_AUTOCHECKBOX |
WS_GROUP | WS_TABSTOP,25,1
11
,59,10
WS_GROUP | WS_TABSTOP,25,1
50
,59,10
CONTROL "Fake &Index",DS_FAKEOIDINDEX,"Button",BS_AUTOCHECKBOX |
WS_GROUP | WS_TABSTOP,115,1
11
,51,10
RTEXT "Connect &Settings:",IDC_STATIC,10,1
35
,35,25
EDITTEXT DS_CONNSETTINGS,50,1
35
,200,20,ES_MULTILINE |
WS_GROUP | WS_TABSTOP,115,1
50
,51,10
RTEXT "Connect &Settings:",IDC_STATIC,10,1
74
,35,25
EDITTEXT DS_CONNSETTINGS,50,1
74
,200,20,ES_MULTILINE |
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
DEFPUSHBUTTON "OK",IDOK,71,165,50,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,146,165,50,14
DEFPUSHBUTTON "Close",IDOK,51,196,50,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,126,196,50,14
PUSHBUTTON "Apply",IDAPPLY,201,196,50,14
END
#endif
...
...
src/interfaces/odbc/resource.h
View file @
89d6f680
...
...
@@ -55,6 +55,16 @@
#define DS_LFCONVERSION 1062
#define DS_TRUEISMINUS1 1063
#define DS_UPDATABLECURSORS 1064
#define IDNEXTPAGE 1065
#define IDPREVPAGE 1066
#define DS_INT8_AS_DEFAULT 1067
#define DS_INT8_AS_BIGINT 1068
#define DS_INT8_AS_NUMERIC 1069
#define DS_INT8_AS_VARCHAR 1070
#define DS_INT8_AS_DOUBLE 1071
#define DS_INT8_AS_INT4 1072
#define DRV_MSG_LABEL2 1073
#define IDAPPLY 1074
/* Next default values for new objects */
/* */
...
...
@@ -62,7 +72,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 10
6
5
#define _APS_NEXT_CONTROL_VALUE 10
7
5
#define _APS_NEXT_SYMED_VALUE 101
#endif
/* */
...
...
src/interfaces/odbc/results.c
View file @
89d6f680
...
...
@@ -850,7 +850,7 @@ PGAPI_GetData(
break
;
default:
stmt
->
errormsg
=
"Column 0 is not of type SQL_C_BOOKMARK"
;
inolog
(
"Column 0 is type %d not of type SQL_C_BOOKMARK"
,
fCType
);
inolog
(
"Column 0 is type %d not of type SQL_C_BOOKMARK"
,
fCType
);
stmt
->
errornumber
=
STMT_PROGRAM_TYPE_OUT_OF_RANGE
;
SC_log_error
(
func
,
""
,
stmt
);
return
SQL_ERROR
;
...
...
@@ -1720,6 +1720,8 @@ static void UndoRollback(StatementClass *stmt, QResultClass *res)
{
if
(
0
!=
(
status
&
CURS_SELF_DELETING
))
DiscardDeleted
(
res
,
index
);
keyset
[
index
].
blocknum
=
rollback
[
i
].
blocknum
;
keyset
[
index
].
offset
=
rollback
[
i
].
offset
;
if
(
0
!=
(
keyset
[
index
].
status
&
CURS_SELF_UPDATING
))
keyset
[
index
].
status
|=
CURS_NEEDS_REREAD
;
keyset
[
index
].
status
&=
~
(
CURS_SELF_DELETING
|
CURS_SELF_UPDATING
|
CURS_SELF_ADDING
|
KEYSET_INFO_PUBLIC
);
...
...
src/interfaces/odbc/setup.c
View file @
89d6f680
...
...
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include "resource.h"
#include "dlg_specific.h"
#include "win_setup.h"
#define INTFUNC __stdcall
...
...
@@ -39,28 +40,6 @@ extern HINSTANCE NEAR s_hModule; /* Saved module handle. */
#define MAXDSNAME (32+1)
/* Max data source name length */
/* Globals */
/* NOTE: All these are used by the dialog procedures */
typedef
struct
tagSETUPDLG
{
HWND
hwndParent
;
/* Parent window handle */
LPCSTR
lpszDrvr
;
/* Driver description */
ConnInfo
ci
;
char
szDSN
[
MAXDSNAME
];
/* Original data source name */
BOOL
fNewDSN
;
/* New data source flag */
BOOL
fDefault
;
/* Default data source flag */
}
SETUPDLG
,
FAR
*
LPSETUPDLG
;
/* Prototypes */
void
INTFUNC
CenterDialog
(
HWND
hdlg
);
int
CALLBACK
ConfigDlgProc
(
HWND
hdlg
,
UINT
wMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
void
INTFUNC
ParseAttributes
(
LPCSTR
lpszAttributes
,
LPSETUPDLG
lpsetupdlg
);
BOOL
INTFUNC
SetDSNAttributes
(
HWND
hwnd
,
LPSETUPDLG
lpsetupdlg
);
/*--------
* ConfigDSN
*
...
...
@@ -217,6 +196,7 @@ ConfigDlgProc(HWND hdlg,
{
LPSETUPDLG
lpsetupdlg
;
ConnInfo
*
ci
;
DWORD
cmd
;
switch
(
wMsg
)
{
...
...
@@ -227,6 +207,7 @@ ConfigDlgProc(HWND hdlg,
/* Hide the driver connect message */
ShowWindow
(
GetDlgItem
(
hdlg
,
DRV_MSG_LABEL
),
SW_HIDE
);
SetWindowText
(
GetDlgItem
(
hdlg
,
IDOK
),
"Save"
);
SetWindowLong
(
hdlg
,
DWL_USER
,
lParam
);
CenterDialog
(
hdlg
);
/* Center dialog */
...
...
@@ -260,7 +241,7 @@ ConfigDlgProc(HWND hdlg,
/* Process buttons */
case
WM_COMMAND
:
switch
(
GET_WM_COMMAND_ID
(
wParam
,
lParam
))
switch
(
cmd
=
GET_WM_COMMAND_ID
(
wParam
,
lParam
))
{
/*
* Ensure the OK button is enabled only when a data
...
...
@@ -282,6 +263,7 @@ ConfigDlgProc(HWND hdlg,
/* Accept results */
case
IDOK
:
case
IDAPPLY
:
lpsetupdlg
=
(
LPSETUPDLG
)
GetWindowLong
(
hdlg
,
DWL_USER
);
/* Retrieve dialog values */
if
(
!
lpsetupdlg
->
fDefault
)
...
...
@@ -293,23 +275,24 @@ ConfigDlgProc(HWND hdlg,
/* Update ODBC.INI */
SetDSNAttributes
(
hdlg
,
lpsetupdlg
);
if
(
IDAPPLY
==
cmd
)
break
;
/* Return to caller */
case
IDCANCEL
:
EndDialog
(
hdlg
,
wParam
);
return
TRUE
;
case
IDC_D
RIVER
:
case
IDC_D
ATASOURCE
:
lpsetupdlg
=
(
LPSETUPDLG
)
GetWindowLong
(
hdlg
,
DWL_USER
);
DialogBoxParam
(
s_hModule
,
MAKEINTRESOURCE
(
DLG_OPTIONS_DRV
),
hdlg
,
d
river_options
Proc
,
(
LPARAM
)
&
lpsetupdlg
->
ci
);
hdlg
,
d
s_options1
Proc
,
(
LPARAM
)
&
lpsetupdlg
->
ci
);
return
TRUE
;
case
IDC_D
ATASOURCE
:
case
IDC_D
RIVER
:
lpsetupdlg
=
(
LPSETUPDLG
)
GetWindowLong
(
hdlg
,
DWL_USER
);
DialogBoxParam
(
s_hModule
,
MAKEINTRESOURCE
(
DLG_OPTIONS_D
S
),
hdlg
,
d
s
_optionsProc
,
(
LPARAM
)
&
lpsetupdlg
->
ci
);
DialogBoxParam
(
s_hModule
,
MAKEINTRESOURCE
(
DLG_OPTIONS_D
RV
),
hdlg
,
d
river
_optionsProc
,
(
LPARAM
)
&
lpsetupdlg
->
ci
);
return
TRUE
;
}
...
...
@@ -415,6 +398,7 @@ SetDSNAttributes(HWND hwndParent, LPSETUPDLG lpsetupdlg)
}
/* Update ODBC.INI */
writeDriverCommoninfo
(
&
lpsetupdlg
->
ci
);
writeDSNinfo
(
&
lpsetupdlg
->
ci
);
/* If the data source name has changed, remove the old name */
...
...
src/interfaces/odbc/statement.c
View file @
89d6f680
...
...
@@ -337,8 +337,14 @@ void IRDFields_free(IRDFields * self)
int
i
;
for
(
i
=
0
;
i
<
(
int
)
self
->
nfields
;
i
++
)
{
if
(
self
->
fi
[
i
])
{
if
(
self
->
fi
[
i
]
->
schema
)
free
(
self
->
fi
[
i
]
->
schema
);
free
(
self
->
fi
[
i
]);
}
}
free
(
self
->
fi
);
self
->
fi
=
NULL
;
}
...
...
src/interfaces/odbc/win32.mak
View file @
89d6f680
...
...
@@ -63,6 +63,7 @@ CLEAN :
-
@erase
"
$(INTDIR)
\c
onnection.obj"
-
@erase
"
$(INTDIR)
\c
onvert.obj"
-
@erase
"
$(INTDIR)
\d
lg_specific.obj"
-
@erase
"
$(INTDIR)
\d
lg_wingui.obj"
-
@erase
"
$(INTDIR)
\d
rvconn.obj"
-
@erase
"
$(INTDIR)
\e
nviron.obj"
-
@erase
"
$(INTDIR)
\e
xecute.obj"
...
...
@@ -90,6 +91,7 @@ CLEAN :
-@erase
"$(OUTDIR)\psqlodbc.dll"
-@erase
"$(OUTDIR)\psqlodbc.exp"
-@erase
"$(OUTDIR)\psqlodbc.lib"
-@erase
"$(OUTDIR)\psqlodbc.pch"
"$(OUTDIR)"
:
if
not
exist
"$(OUTDIR)/$(NULL)"
mkdir
"$(OUTDIR)"
...
...
@@ -148,6 +150,7 @@ LINK32_OBJS= \
"
$(INTDIR)
\c
onnection.obj"
\
"
$(INTDIR)
\c
onvert.obj"
\
"
$(INTDIR)
\d
lg_specific.obj"
\
"
$(INTDIR)
\d
lg_wingui.obj"
\
"
$(INTDIR)
\d
rvconn.obj"
\
"
$(INTDIR)
\e
nviron.obj"
\
"
$(INTDIR)
\e
xecute.obj"
\
...
...
@@ -196,6 +199,7 @@ CLEAN :
-
@erase
"
$(INTDIR)
\c
onnection.obj"
-
@erase
"
$(INTDIR)
\c
onvert.obj"
-
@erase
"
$(INTDIR)
\d
lg_specific.obj"
-
@erase
"
$(INTDIR)
\d
lg_wingui.obj"
-
@erase
"
$(INTDIR)
\d
rvconn.obj"
-
@erase
"
$(INTDIR)
\e
nviron.obj"
-
@erase
"
$(INTDIR)
\e
xecute.obj"
...
...
@@ -226,6 +230,7 @@ CLEAN :
-@erase
"$(OUTDIR)\psqlodbc.ilk"
-@erase
"$(OUTDIR)\psqlodbc.lib"
-@erase
"$(OUTDIR)\psqlodbc.pdb"
-@erase
"$(OUTDIR)\psqlodbc.pch"
"$(OUTDIR)"
:
if
not
exist
"$(OUTDIR)/$(NULL)"
mkdir
"$(OUTDIR)"
...
...
@@ -284,6 +289,7 @@ LINK32_OBJS= \
"
$(INTDIR)
\c
onnection.obj"
\
"
$(INTDIR)
\c
onvert.obj"
\
"
$(INTDIR)
\d
lg_specific.obj"
\
"
$(INTDIR)
\d
lg_wingui.obj"
\
"
$(INTDIR)
\d
rvconn.obj"
\
"
$(INTDIR)
\e
nviron.obj"
\
"
$(INTDIR)
\e
xecute.obj"
\
...
...
@@ -347,6 +353,12 @@ SOURCE=dlg_specific.c
$(CPP)
$(CPP_PROJ)
$(SOURCE)
SOURCE
=
dlg_wingui.c
"$(INTDIR)\dlg_wingui.obj"
:
$(SOURCE)
"$(INTDIR)"
$(CPP)
$(CPP_PROJ)
$(SOURCE)
SOURCE
=
drvconn.c
"$(INTDIR)\drvconn.obj"
:
$(SOURCE)
"$(INTDIR)"
...
...
src/interfaces/odbc/win32_30.mak
View file @
89d6f680
#
# File: win32_30.mak
#
...
...
@@ -63,6 +62,7 @@ CLEAN :
-
@erase
"
$(INTDIR)
\c
onnection.obj"
-
@erase
"
$(INTDIR)
\c
onvert.obj"
-
@erase
"
$(INTDIR)
\d
lg_specific.obj"
-
@erase
"
$(INTDIR)
\d
lg_wingui.obj"
-
@erase
"
$(INTDIR)
\d
rvconn.obj"
-
@erase
"
$(INTDIR)
\e
nviron.obj"
-
@erase
"
$(INTDIR)
\e
xecute.obj"
...
...
@@ -93,6 +93,7 @@ CLEAN :
-@erase
"$(OUTDIR)\psqlodbc30.dll"
-@erase
"$(OUTDIR)\psqlodbc.exp"
-@erase
"$(OUTDIR)\psqlodbc.lib"
-@erase
"$(OUTDIR)\psqlodbc.pch"
"$(OUTDIR)"
:
if
not
exist
"$(OUTDIR)/$(NULL)"
mkdir
"$(OUTDIR)"
...
...
@@ -151,6 +152,7 @@ LINK32_OBJS= \
"
$(INTDIR)
\c
onnection.obj"
\
"
$(INTDIR)
\c
onvert.obj"
\
"
$(INTDIR)
\d
lg_specific.obj"
\
"
$(INTDIR)
\d
lg_wingui.obj"
\
"
$(INTDIR)
\d
rvconn.obj"
\
"
$(INTDIR)
\e
nviron.obj"
\
"
$(INTDIR)
\e
xecute.obj"
\
...
...
@@ -202,6 +204,7 @@ CLEAN :
-
@erase
"
$(INTDIR)
\c
onnection.obj"
-
@erase
"
$(INTDIR)
\c
onvert.obj"
-
@erase
"
$(INTDIR)
\d
lg_specific.obj"
-
@erase
"
$(INTDIR)
\d
lg_wingui.obj"
-
@erase
"
$(INTDIR)
\d
rvconn.obj"
-
@erase
"
$(INTDIR)
\e
nviron.obj"
-
@erase
"
$(INTDIR)
\e
xecute.obj"
...
...
@@ -235,6 +238,7 @@ CLEAN :
-@erase
"$(OUTDIR)\psqlodbc.ilk"
-@erase
"$(OUTDIR)\psqlodbc.lib"
-@erase
"$(OUTDIR)\psqlodbc.pdb"
-@erase
"$(OUTDIR)\psqlodbc.pch"
"$(OUTDIR)"
:
if
not
exist
"$(OUTDIR)/$(NULL)"
mkdir
"$(OUTDIR)"
...
...
@@ -293,6 +297,7 @@ LINK32_OBJS= \
"
$(INTDIR)
\c
onnection.obj"
\
"
$(INTDIR)
\c
onvert.obj"
\
"
$(INTDIR)
\d
lg_specific.obj"
\
"
$(INTDIR)
\d
lg_wingui.obj"
\
"
$(INTDIR)
\d
rvconn.obj"
\
"
$(INTDIR)
\e
nviron.obj"
\
"
$(INTDIR)
\e
xecute.obj"
\
...
...
@@ -359,6 +364,12 @@ SOURCE=dlg_specific.c
$(CPP)
$(CPP_PROJ)
$(SOURCE)
SOURCE
=
dlg_wingui.c
"$(INTDIR)\dlg_wingui.obj"
:
$(SOURCE)
"$(INTDIR)"
$(CPP)
$(CPP_PROJ)
$(SOURCE)
SOURCE
=
drvconn.c
"$(INTDIR)\drvconn.obj"
:
$(SOURCE)
"$(INTDIR)"
...
...
src/interfaces/odbc/win32_30w.mak
View file @
89d6f680
...
...
@@ -54,6 +54,7 @@ CLEAN :
-
@erase
"
$(INTDIR)
\c
onnection.obj"
-
@erase
"
$(INTDIR)
\c
onvert.obj"
-
@erase
"
$(INTDIR)
\d
lg_specific.obj"
-
@erase
"
$(INTDIR)
\d
lg_wingui.obj"
-
@erase
"
$(INTDIR)
\d
rvconn.obj"
-
@erase
"
$(INTDIR)
\e
nviron.obj"
-
@erase
"
$(INTDIR)
\e
xecute.obj"
...
...
@@ -85,6 +86,7 @@ CLEAN :
-
@erase
"
$(OUTDIR)
\p
sqlodbc30w.dll"
-
@erase
"
$(OUTDIR)
\p
sqlodbc.exp"
-
@erase
"
$(OUTDIR)
\p
sqlodbc.lib"
-
@erase
"
$(OUTDIR)
\p
sqlodbc.pch"
"$(OUTDIR)"
:
if
not
exist
"$(OUTDIR)/$(NULL)"
mkdir
"$(OUTDIR)"
...
...
@@ -139,6 +141,7 @@ LINK32_OBJS= \
"
$(INTDIR)
\c
onnection.obj"
\
"
$(INTDIR)
\c
onvert.obj"
\
"
$(INTDIR)
\d
lg_specific.obj"
\
"
$(INTDIR)
\d
lg_wingui.obj"
\
"
$(INTDIR)
\d
rvconn.obj"
\
"
$(INTDIR)
\e
nviron.obj"
\
"
$(INTDIR)
\e
xecute.obj"
\
...
...
@@ -183,6 +186,7 @@ CLEAN :
-
@erase
"
$(INTDIR)
\c
onnection.obj"
-
@erase
"
$(INTDIR)
\c
onvert.obj"
-
@erase
"
$(INTDIR)
\d
lg_specific.obj"
-
@erase
"
$(INTDIR)
\d
lg_wingui.obj"
-
@erase
"
$(INTDIR)
\d
rvconn.obj"
-
@erase
"
$(INTDIR)
\e
nviron.obj"
-
@erase
"
$(INTDIR)
\e
xecute.obj"
...
...
@@ -217,6 +221,7 @@ CLEAN :
-
@erase
"
$(OUTDIR)
\p
sqlodbc.ilk"
-
@erase
"
$(OUTDIR)
\p
sqlodbc.lib"
-
@erase
"
$(OUTDIR)
\p
sqlodbc.pdb"
-
@erase
"
$(OUTDIR)
\p
sqlodbc.pch"
"$(OUTDIR)"
:
if
not
exist
"$(OUTDIR)/$(NULL)"
mkdir
"$(OUTDIR)"
...
...
@@ -271,6 +276,7 @@ LINK32_OBJS= \
"
$(INTDIR)
\c
onnection.obj"
\
"
$(INTDIR)
\c
onvert.obj"
\
"
$(INTDIR)
\d
lg_specific.obj"
\
"
$(INTDIR)
\d
lg_wingui.obj"
\
"
$(INTDIR)
\d
rvconn.obj"
\
"
$(INTDIR)
\e
nviron.obj"
\
"
$(INTDIR)
\e
xecute.obj"
\
...
...
@@ -338,6 +344,12 @@ SOURCE=dlg_specific.c
$(CPP)
$(CPP_PROJ)
$(SOURCE)
SOURCE
=
dlg_wingui.c
"$(INTDIR)\dlg_wingui.obj"
:
$(SOURCE)
"$(INTDIR)"
$(CPP)
$(CPP_PROJ)
$(SOURCE)
SOURCE
=
drvconn.c
"$(INTDIR)\drvconn.obj"
:
$(SOURCE)
"$(INTDIR)"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment