Linux SQLDriverConnectW fails but SQLDriverConnect works.

--0016364593c46e489a047d60f43b
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Any suggestions as to why the following fails. Using the non-W calls to the
same DSN works okay from same application and versions of unixODBC 2.2.11

Unfortunately, none of the debug/comm logging of postgres gets generated
(does if a successful attach occurs).


Client encoding changed to: UCS2
Content encoding changed to: UCS2
ANSI encoding changed to: UTF-8
SQL_SUCCESS =3D SQLAllocHandle(HandleType =3D SQL_HANDLE_ENV,
InputHandle =3D 0x0, OutputHandlePtr =3D 0xa451c08)
SQL_SUCCESS =3D SQLSetEnvAttr(EnvironmentHandle =3D0xa451c08,
Attribute =3D SQL_ATTR_ODBC_VERSION, Value=3DSQL_OV_ODBC3,StringLength =3D =
0)
SQL_SUCCESS =3D SQLAllocHandle(HandleType =3D SQL_HANDLE_DBC,
InputHandle =3D 0xa451c08, OutputHandlePtr =3D 0xa452198)
SQL_SUCCESS =3D SQLSetConnectAttrW(ConnectionHandle =3D0xa452198,
attribute =3D SQL_ATTR_ODBC_CURSORS, Value=3DSQL_CUR_USE_DRIVER,StringLengt=
h =3D
0)
SQL_ERROR =3D SQLDriverConnectW(ConnectionHandle =3D
0xa452198,WindowHandle =3D <null pointer>,InConnectionString =3D
DSN=3DPG84LOCAL;UID=3Dtest;PWD=3D********;;,StringLength1 =3D
SQL_NTS,OutConnectionString =3D ä=94=B0=CA=89ä=94=B0=CA=89=E3=94=88=E0=
=A9=85=E3=94=88=E0=A9=85,BufferLength =3D 1024,StringLength2Ptr
=3D 0SQL_DRIVER_NOPROMPT)
SQL_SUCCESS =3D SQLGetDiagRecW(HandleType =3D SQL_HANDLE_DBC, Han=
dle =3D
0xa452198, RecNumber =3D 1, SQLState =3D 0, NativeErrorPtr =3D 0, MessageTe=
xt =3D
[unixODBC]c, BufferLength =3D 512, TextLengthPtr =3D 11)
SQL_NO_DATA_FOUND =3D SQLGetDiagRecW(HandleType =3D SQL_HANDLE_DBC, Han=
dle =3D
0xa452198, RecNumber =3D 2, SQLState =3D 00000, NativeErrorPtr =3D 0, Messa=
geText
=3D [unixODBC]c, BufferLength =3D 512, TextLengthPtr =3D 0)


SQL_DATETIME_LITERALS=3D119 (3.0) Not Supported
SQL_DBMS_NAME=3D17 (1.0) =3D "PostgreSQL"
SQL_DBMS_VER=3D18 (1.0) =3D "8.4.2"
......
SQL_DM_VER=3D171 (1.0) =3D "03.52.0002.0002"
SQL_DRIVER_HDESC=3D135 (3.0) Not Supported
SQL_DRIVER_HSTMT=3D5 (1.0) Not Supported
SQL_DRIVER_NAME=3D6 (1.0) =3D "psqlodbcw.so"
SQL_DRIVER_ODBC_VER=3D77 (2.0) =3D "03.51"
SQL_DRIVER_VER=3D7 (1.0) =3D "08.04.0100"

--0016364593c46e489a047d60f43b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Any suggestions as to why the following fails. Using the non-W calls to the=
same DSN works okay from same application and versions of unixODBC 2.2.11<=
br><br>Unfortunately, none of the debug/comm logging of postgres gets gener=
ated (does if a successful attach occurs).<br>
<br><br>Client encoding changed to: UCS2<br>Content encoding changed to: UC=
S2<br>ANSI encoding changed to: UTF-8<br>SQL_SUCCESS=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D SQLAllocHandle(HandleType =3D S=
QL_HANDLE_ENV, InputHandle =3D 0x0, OutputHandlePtr =3D 0xa451c08)<br>
SQL_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= C2=A0=C2=A0 =3D=
SQLSetEnvAttr(EnvironmentHandle =3D0xa451c08, Attribute =3D SQL_ATTR_ODBC_=
VERSION, Value=3DSQL_OV_ODBC3,StringLength =3D 0)<br>SQL_SUCCESS=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D SQLAllocHandle(Hand=
leType =3D SQL_HANDLE_DBC, InputHandle =3D 0xa451c08, OutputHandlePtr =3D 0=
xa452198)<br>
SQL_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= C2=A0=C2=A0 =3D=
SQLSetConnectAttrW(ConnectionHandle =3D0xa452198, attribute =3D SQL_ATTR_O=
DBC_CURSORS, Value=3DSQL_CUR_USE_DRIVER,StringLength=C2=A0 =3D 0)<br>SQL_ER=
ROR=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2 =A0=C2=A0=C2=A0=
=3D SQLDriverConnectW(ConnectionHandle =3D 0xa452198,WindowHandle=C2=A0 =
=3D <null pointer>,InConnectionString =3D DSN=3DPG84LOCAL;UID=3Dtest;=
PWD=3D********;;,StringLength1 =3D SQL_NTS,OutConnectionString =3D ä=94=
=B0=CA=89ä=94=B0=CA=89=E3=94=88=E0=A9=85=E3=94=88=E0=A9=85 ,BufferLength =
=3D 1024,StringLength2Ptr =3D 0SQL_DRIVER_NOPROMPT)<br>
SQL_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= C2=A0=C2=A0 =3D=
SQLGetDiagRecW(HandleType =3D SQL_HANDLE_DBC, Handle =3D 0xa452198, RecNum=
ber =3D 1, SQLState =3D 0, NativeErrorPtr =3D 0, MessageText =3D [unixODBC]=
c, BufferLength =3D 512, TextLengthPtr =3D 11)<br>SQL_NO_DATA_FOUND=C2=A0=
=C2=A0=C2=A0=C2=A0 =3D SQLGetDiagRecW(HandleType =3D SQL_HANDLE_DBC, Handle=
=3D 0xa452198, RecNumber =3D 2, SQLState =3D 00000, NativeErrorPtr =3D 0, =
MessageText =3D [unixODBC]c, BufferLength =3D 512, TextLengthPtr =3D 0)<br>
<br><br>SQL_DATETIME_LITERALS=3D119 (3.0) Not Supported<br>=C2=A0=C2=A0=C2=
=A0 SQL_DBMS_NAME=3D17 (1.0) =3D "PostgreSQL"<br>=C2=A0=C2=A0=C2=
=A0 SQL_DBMS_VER=3D18 (1.0) =3D "8.4.2"<br>=C2=A0=C2=A0=C2=A0 ...=
....<br>=C2=A0=C2=A0=C2=A0 SQL_DM_VER=3D171 (1.0) =3D "03.52.0002.0002&=
quot;<br>
=C2=A0=C2=A0=C2=A0 SQL_DRIVER_HDESC=3D135 (3.0) Not Supported<br>=C2=A0=C2=
=A0=C2=A0 SQL_DRIVER_HSTMT=3D5 (1.0) Not Supported<br>=C2=A0=C2=A0=C2=A0 SQ=
L_DRIVER_NAME=3D6 (1.0) =3D "psqlodbcw.so"<br>=C2=A0=C2=A0=C2=A0 =
SQL_DRIVER_ODBC_VER=3D77 (2.0) =3D "03.51"<br>=C2=A0=C2=A0=C2=A0 =
SQL_DRIVER_VER=3D7 (1.0) =3D "08.04.0100"<br>
<br>

--0016364593c46e489a047d60f43b--
the6campbells [ So, 17 Januar 2010 20:07 ] [ ID #2028997 ]

Re: Linux SQLDriverConnectW fails but SQLDriverConnect works.

the6campbells wrote:
> Any suggestions as to why the following fails. Using the non-W calls to=

> the same DSN works okay from same application and versions of unixODBC
> 2.2.11
>
> Unfortunately, none of the debug/comm logging of postgres gets generate=
d
> (does if a successful attach occurs).
>
>
> Client encoding changed to: UCS2
> Content encoding changed to: UCS2
> ANSI encoding changed to: UTF-8
> SQL_SUCCESS =3D SQLAllocHandle(HandleType =3D SQL_HANDLE_ENV,=

> InputHandle =3D 0x0, OutputHandlePtr =3D 0xa451c08)
> SQL_SUCCESS =3D SQLSetEnvAttr(EnvironmentHandle =3D0xa451c08,=

> Attribute =3D SQL_ATTR_ODBC_VERSION, Value=3DSQL_OV_ODBC3,StringLength =
=3D 0)
> SQL_SUCCESS =3D SQLAllocHandle(HandleType =3D SQL_HANDLE_DBC,=

> InputHandle =3D 0xa451c08, OutputHandlePtr =3D 0xa452198)
> SQL_SUCCESS =3D SQLSetConnectAttrW(ConnectionHandle =3D0xa452=
198,
> attribute =3D SQL_ATTR_ODBC_CURSORS,
> Value=3DSQL_CUR_USE_DRIVER,StringLength =3D 0)
> SQL_ERROR =3D SQLDriverConnectW(ConnectionHandle =3D
> 0xa452198,WindowHandle =3D <null pointer>,

InConnectionString =3D DSN=3DPG84LOCAL;UID=3Dtest;PWD=3D********;

Is the InConnetcString a UCS2 string?

> ;,StringLength1 =3D
> SQL_NTS,OutConnectionString =3D ä=94=B0=CA=89ä=94=B0=CA=89=E3=94=88=
=E0=A9=85=E3=94=88=E0=A9=85,BufferLength =3D
> 1024,StringLength2Ptr =3D 0SQL_DRIVER_NOPROMPT)
> SQL_SUCCESS =3D SQLGetDiagRecW(HandleType =3D SQL_HANDLE_DBC,=

> Handle =3D 0xa452198, RecNumber =3D 1, SQLState =3D 0, NativeErrorPtr =3D=
0,
> MessageText =3D [unixODBC]c, BufferLength =3D 512, TextLengthPtr =3D 11=
)
> SQL_NO_DATA_FOUND =3D SQLGetDiagRecW(HandleType =3D SQL_HANDLE_DBC,=

> Handle =3D 0xa452198, RecNumber =3D 2, SQLState =3D 00000, NativeErrorP=
tr =3D 0,
> MessageText =3D [unixODBC]c, BufferLength =3D 512, TextLengthPtr =3D 0)
>
>
> SQL_DATETIME_LITERALS=3D119 (3.0) Not Supported
> SQL_DBMS_NAME=3D17 (1.0) =3D "PostgreSQL"
> SQL_DBMS_VER=3D18 (1.0) =3D "8.4.2"
> ......
> SQL_DM_VER=3D171 (1.0) =3D "03.52.0002.0002"
> SQL_DRIVER_HDESC=3D135 (3.0) Not Supported
> SQL_DRIVER_HSTMT=3D5 (1.0) Not Supported
> SQL_DRIVER_NAME=3D6 (1.0) =3D "psqlodbcw.so"
> SQL_DRIVER_ODBC_VER=3D77 (2.0) =3D "03.51"
> SQL_DRIVER_VER=3D7 (1.0) =3D "08.04.0100"

--
Sent via pgsql-odbc mailing list (pgsql-odbc [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Hiroshi Inoue [ Mo, 18 Januar 2010 00:12 ] [ ID #2029069 ]
Datenbanken » gmane.comp.db.postgresql.odbc » Linux SQLDriverConnectW fails but SQLDriverConnect works.

Vorheriges Thema: buffer overflow in 08.04.0100 und 08.04.0200?
Nächstes Thema: sum(decimal) not returning dp when query run via ODBC on Linux