Skip site navigation (1) Skip section navigation (2)

PostgreSQL ODBC 8.04.0200 and Crystal Reports XI Developer

From: Raiford(at)labware(dot)com
To: pgsql-odbc(at)postgresql(dot)org
Subject: PostgreSQL ODBC 8.04.0200 and Crystal Reports XI Developer
Date: 2010-10-04 22:02:21
Message-ID: OF6B754590.B68ACACC-ON852577B2.0075676A-852577B2.0079108B@labware.com (view raw or flat)
Thread:
Lists: pgsql-odbc
Hi everyone, 

Before I explain my problem I want to mention that this is a critical 
issue for me.  If this is not the correct forum for resolving this issue 
in the driver, please point me to the proper place.

Whenever I try to use Crystal Reports with PostgreSQL ODBC, I get an error 
"logon failed".  There is not much available on this error online and no 
real solution that I'm aware of.  When I compare the ODBC trace and the 
mylog log files (shown below), you will see that the problem is that 
something is telling the Postgres driver to connect again.  If that wasn't 
weird enough, in the connection information, instead of using the correct 
database name, its telling it to use a database name that matches the 
datasource name.  I suppose I might be able to trick it by naming my 
database the same as the datasource, but that isn't a good generic 
solution.

Jon



My environment info:
Crystal Reports 11 Developer Edition
Postgres ODBC Driver Version='08.04.0200,200912260001' linking 1500 static 
Multithread library
Postgres Server version=8.4.4


Here is what I see using ODBC Tracing.  This is the only thing that 
appears in the SQL log when I tell Crystal to use my existing ODBC 
connection.  I have shortened the format to make it readable.  If you want 
anything that isn't listed, I can provide the rest:

SQLGetInfoW  ( 6 <SQL_DRIVER_NAME> ) -> return code 0 (SQL_SUCCESS)  -> 
"PSQLODBC35W.DLL"
SQLGetInfoW  ( 6 <SQL_DRIVER_NAME> ) -> return code 0 (SQL_SUCCESS)  -> 
"PSQLODBC35W.DLL"
SQLGetInfoW  (14 <SQL_SEARCH_PATTERN_ESCAPE> ) -> return code 0 
(SQL_SUCCESS)  ->  "\"
SQLGetInfoW  (17 <SQL_DBMS_NAME> ) -> return code 0 (SQL_SUCCESS)  -> 
"PostgreSQL"
SQLGetInfoW  (18 <SQL_DBMS_VER> ) -> return code 0 (SQL_SUCCESS)  -> 
"8.4.4"
SQLGetInfoW  (77 <SQL_DRIVER_ODBC_VER> ) -> return code 0 (SQL_SUCCESS) -> 
"03.51"
SQLGetInfoW  (10 <SQL_ODBC_VER> ) -> return code 0 (SQL_SUCCESS)  -> 
"03.52.0000"
SQLGetInfoW  (29 <SQL_IDENTIFIER_QUOTE_CHAR> ) -> return code 0 
(SQL_SUCCESS)  -> """
SQLGetInfoW  (41 <SQL_CATALOG_NAME_SEPARATOR> ) -> return code 0 
(SQL_SUCCESS)  -> "."
SQLGetInfoW  (114 <SQL_CATALOG_LOCATION> ) -> return code 0 (SQL_SUCCESS) 
-> PTR  0x07A58700 (1)
SQLGetInfoW  (10003 <SQL_CATALOG_NAME> ) -> return code 0 (SQL_SUCCESS) -> 
"Y"
SQLGetInfoW  (21 <SQL_PROCEDURES>) -> return code 0 (SQL_SUCCESS) -> "Y"
SQLGetInfoW (10021 <SQL_ASYNC_MODE>) -> return code 0 (SQL_SUCCESS) -> PTR 
 0x07A58754 (0)
SQLGetInfoW (115 <SQL_OJ_CAPABILITIES>) -> with return code 0 
(SQL_SUCCESS) -> PTR  07A58758
SQLGetInfoW (84 <SQL_FILE_USAGE>) -> with return code 0 (SQL_SUCCESS) -> 
PTR  0x07A5875C (0)
SQLGetInfoW (39 <SQL_OWNER_TERM>) -> with return code 0 (SQL_SUCCESS) -> 
"schema"
SQLGetInfoW (74 <SQL_CORRELATION_NAME>) -> with return code 0 
(SQL_SUCCESS) -> PTR  0x0012D8C8 (2)

Here is what I get in the mylog_1736.log (unaltered):

[3596-77.711][[SQLAllocHandle]][3596-77.711]**** in PGAPI_AllocEnv ** 
[3596-77.711]** exit PGAPI_AllocEnv: phenv = 08ABC6C0 **
[3596-77.711][[SQLSetEnvAttr]] att=200,3
[3596-77.711][[SQLAllocHandle]][3596-77.711]PGAPI_AllocConnect: 
entering...
[3596-77.711]**** PGAPI_AllocConnect: henv = 08ABC6C0, conn = 08ACA008
[3596-77.711]EN_add_connection: self = 08ABC6C0, conn = 08ACA008
[3596-77.711]       added at i=2, conn->henv = 08ABC6C0, conns[i]->henv = 
08ABC6C0
[3596-77.711][SQLGetInfoW(30)][3596-77.711]PGAPI_GetInfo: 
entering...fInfoType=77
[3596-77.711]PGAPI_GetInfo: p='03.51', len=0, value=0, cbMax=12
[3596-77.711][SQLSetConnectAttrW][3596-77.711]PGAPI_SetConnectAttr for 
08ACA008: 115 00000000
[3596-77.711]the application is unicode
[3596-77.711][SQLSetConnectAttrW][3596-77.711]PGAPI_SetConnectAttr for 
08ACA008: 101 00000001
[3596-77.711]PGAPI_SetConnectOption: entering fOption = 101 vParam = 1
[3596-77.711][SQLSetConnectAttrW][3596-77.711]PGAPI_SetConnectAttr for 
08ACA008: 111 076421B8
[3596-77.721]PGAPI_SetConnectOption: entering fOption = 111 vParam = 
124002744
[3596-77.721][SQLDriverConnectW][3596-77.721]PGAPI_DriverConnect: 
entering...
[3596-77.721]**** PGAPI_DriverConnect: fDriverCompletion=0, 
connStrIn='DSN=6 Base Postgres;UID=postgres;PWD=xxxx;DATABASE=6 Base 
Postgres;'
[3596-77.721]our_connect_string = 'DSN=6 Base 
Postgres;UID=postgres;PWD=xxxx;DATABASE=6 Base Postgres;'
[3596-77.721]attribute = 'DSN', value = '6 Base Postgres'
[3596-77.721]copyAttributes: DSN='6 Base 
Postgres',server='',dbase='',user='',passwd='xxxxx',port='',onlyread='',protocol='',conn_settings='',disallow_premature=-1)
[3596-77.721]attribute = 'UID', value = 'postgres'
[3596-77.721]copyAttributes: DSN='6 Base 
Postgres',server='',dbase='',user='postgres',passwd='xxxxx',port='',onlyread='',protocol='',conn_settings='',disallow_premature=-1)
[3596-77.721]attribute = 'PWD', value = 'xxxxx'
[3596-77.721]copyAttributes: DSN='6 Base 
Postgres',server='',dbase='',user='postgres',passwd='xxxxx',port='',onlyread='',protocol='',conn_settings='',disallow_premature=-1)
[3596-77.721]attribute = 'DATABASE', value = '6 Base Postgres'
[3596-77.721]copyAttributes: DSN='6 Base Postgres',server='',dbase='6 Base 
Postgres',user='postgres',passwd='xxxxx',port='',onlyread='',protocol='',conn_settings='',disallow_premature=-1)
[3596-77.721]getDSNinfo: DSN=6 Base Postgres overwrite=0
[3596-77.721]rollback_on_error=1
[3596-77.721]force_abbrev=0 bde=0 cvt_null_date=0
[3596-77.721]globals.extra_systable_prefixes = 'dd_;'
[3596-77.721]our_connect_string = 'DSN=6 Base 
Postgres;UID=postgres;PWD=xxxx;DATABASE=6 Base Postgres;'
[3596-77.721]attribute = 'DSN', value = '6 Base Postgres'
[3596-77.721]copyCommonAttributes: 
A7=100;A8=4096;A9=0;B0=255;B1=8190;B2=1;B3=0;B4=0;B5=1;B6=0;B7=1;B8=0;B9=1;C0=0;C1=0;C2=dd_;[3596-77.731]attribute 
= 'UID', value = 'postgres'
[3596-77.731]copyCommonAttributes: 
A7=100;A8=4096;A9=0;B0=255;B1=8190;B2=1;B3=0;B4=0;B5=1;B6=0;B7=1;B8=0;B9=1;C0=0;C1=0;C2=dd_;[3596-77.731]attribute 
= 'PWD', value = 'xxxxx'
[3596-77.731]copyCommonAttributes: 
A7=100;A8=4096;A9=0;B0=255;B1=8190;B2=1;B3=0;B4=0;B5=1;B6=0;B7=1;B8=0;B9=1;C0=0;C1=0;C2=dd_;[3596-77.731]attribute 
= 'DATABASE', value = '6 Base Postgres'
[3596-77.731]copyCommonAttributes: 
A7=100;A8=4096;A9=0;B0=255;B1=8190;B2=1;B3=0;B4=0;B5=1;B6=0;B7=1;B8=0;B9=1;C0=0;C1=0;C2=dd_;[3596-77.731]calling 
getDSNdefaults
[3596-77.731]CC_connect: entering...
[3596-77.731]sslmode=prefer
[3596-77.731]LIBPQ_CC_connect: entering...
[3596-77.731]Driver Version='08.04.0200,200912260001' linking 1500 static 
Multithread library
[3596-77.731]LIBPQ_CC_connect: DSN = '6 Base Postgres', server = 
'vm-postgres', port = '5432', database = '6 Base Postgres', username = 
'postgres', password='xxxxx'
[3596-77.731]connecting to the database  using vm-postgres as the server
[3596-77.731]sizeof connectdb option = 106
[3596-77.751]CC_error_statements: self=08ACA008
[3596-77.751]CONN ERROR: func=LIBPQ_connect, desc='', errnum=101, 
errmsg='FATAL:  database "6 Base Postgres" does not exist
'
[3596-77.751]Could not establish connection to the database; LIBPQ 
returned -> FATAL:  database "6 Base Postgres" does not exist

[3596-77.761]SOCK_Destructor
[3596-77.761]CONN ERROR: func=PGAPI_DriverConnect, desc='Error from 
CC_Connect', errnum=101, errmsg='FATAL:  database "6 Base Postgres" does 
not exist
'
[3596-77.761][SQLGetDiagRecW][3596-77.761]PGAPI_GetDiagRec entering type=2 
rec=1
[3596-77.761]**** PGAPI_ConnectError: hdbc=08ACA008 <0>
[3596-77.761]enter CC_get_error
[3596-77.761]enter CC_create_errormsg
[3596-77.761]msg = 'FATAL:  database "6 Base Postgres" does not exist
'
[3596-77.761]exit CC_create_errormsg
[3596-77.761]exit CC_get_error
[3596-77.761]CC_get_error: status = 101, msg = #FATAL:  database "6 Base 
Postgres" does not exist
#
[3596-77.761]        szSqlState = '08001',len=50, szError='(null)'
[3596-77.761]PGAPI_GetDiagRec exiting 1
[3596-77.761][SQLGetDiagRecW][3596-77.761]PGAPI_GetDiagRec entering type=2 
rec=1
[3596-77.761]**** PGAPI_ConnectError: hdbc=08ACA008 <52>
[3596-77.761]enter CC_get_error
[3596-77.761]exit CC_get_error
[3596-77.761]CC_get_error: status = 101, msg = #FATAL:  database "6 Base 
Postgres" does not exist
#
[3596-77.761]        szSqlState = '(null)',len=50, szError='FATAL: 
database "6 Base Postgres" does not exist
'
[3596-77.761]PGAPI_GetDiagRec exiting 0
[3596-77.761][[SQLGetDiagFieldW]] Handle=(2,08ACA008) Rec=1 Id=8 
info=(0012B6D8,256)
[3596-77.761]PGAPI_GetDiagField entering 
rec=1[3596-77.761]PGAPI_GetDiagField exiting 0
[3596-77.761][[SQLGetDiagFieldW]] Handle=(2,08ACA008) Rec=1 Id=9 
info=(0012B6D8,256)
[3596-77.761]PGAPI_GetDiagField entering 
rec=1[3596-77.761]PGAPI_GetDiagField exiting 0
[3596-77.761][[SQLGetDiagFieldW]] Handle=(2,08ACA008) Rec=1 Id=10 
info=(0012B6D8,256)
[3596-77.761]PGAPI_GetDiagField entering 
rec=1[3596-77.761]PGAPI_GetDiagField exiting 0
[3596-77.761][[SQLGetDiagFieldW]] Handle=(2,08ACA008) Rec=1 Id=11 
info=(0012B6D8,256)
[3596-77.761]PGAPI_GetDiagField entering 
rec=1[3596-77.761]PGAPI_GetDiagField exiting 0
[3596-77.761][SQLGetDiagRecW][3596-77.761]PGAPI_GetDiagRec entering type=2 
rec=2
[3596-77.761]**** PGAPI_ConnectError: hdbc=08ACA008 <0>
[3596-77.761]PGAPI_GetDiagRec exiting 100
[3596-77.761][[SQLFreeHandle]][3596-77.761]PGAPI_FreeConnect: entering...
[3596-77.761]**** in PGAPI_FreeConnect: hdbc=08ACA008
[3596-77.761]enter CC_Destructor, self=08ACA008
[3596-77.761]in CC_Cleanup, self=08ACA008
[3596-77.761]after SOCK destructor
[3596-77.761]exit CC_Cleanup
[3596-77.761]after CC_Cleanup
[3596-77.771]after free statement holders
[3596-77.771]exit CC_Destructor
[3596-77.771]PGAPI_FreeConnect: returning...
[3596-77.771][[SQLFreeHandle]][3596-77.771]**** in PGAPI_FreeEnv: env = 
08ABC6C0 ** 
[3596-77.771]in EN_Destructor, self=08ABC6C0
[3596-77.771]exit EN_Destructor: rv = 1
[3596-77.771]   ok

Responses

pgsql-odbc by date

Next:From: Craig RingerDate: 2010-10-07 02:04:39
Subject: [BUGS] BUG #5694: Postgres ODBC SQLTables is not working correctly
Previous:From: Adam MDate: 2010-09-30 16:57:47
Subject: Re: 9.0 driver status

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group