DBWarning exception with Postgres ODBC driver.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DBWarning exception with Postgres ODBC driver.

Craig H. Anderson
Greetings,
I've installed this ODBC Driver
PostreSQL, 6.50.0000, Insight Distribution Systems, PSQLODBC.DLL, 4/2/00

I'm able to open a connection, but get an exception on the tables method:
dbc := ((DBConnection new) dsn: 'RadioFreq') open.
dbc tables.

Things appear to go wrong at the following point.
The error string has no bracket, $].

DBErrorDetails class>>fromSQLError:
aString  is 'Requested value changed.'

 | origin lastBrkt |
 origin := aString reverse.
 lastBrkt := origin indexOf: $].

How should I handle this?

FWIW here is some of the exception stack:

9:04:09 AM, Sunday, January 07, 2001: 'Index 0 is out of bounds'
String(Object)>>errorSubscriptBounds:
String(Object)>>errorAt:
String>>at:
String>>replaceBytesOf:from:to:startingAt:
String>>replaceFrom:to:with:startingAt:
String(SequenceableCollection)>>copyFrom:to:
DBErrorDetails class>>fromSQLError:
DBExceptionDetails>>buildErrorInfo
DBWarning>>signal
DBWarning(Exception)>>signal:with:
DBWarning class(Exception class)>>signal:with:
DBWarning class(Exception class)>>signalWith:
DBTablesStatement(DBAbstractStatement)>>dbCheckException:


Reply | Threaded
Open this post in threaded view
|

Re: DBWarning exception with Postgres ODBC driver.

Blair McGlashan
Craig

You wrote in message news:4F066.6684$[hidden email]...

> Greetings,
> I've installed this ODBC Driver
> PostreSQL, 6.50.0000, Insight Distribution Systems, PSQLODBC.DLL, 4/2/00
>
> I'm able to open a connection, but get an exception on the tables method:
> dbc := ((DBConnection new) dsn: 'RadioFreq') open.
> dbc tables.
>
> Things appear to go wrong at the following point.
> The error string has no bracket, $].

Hmmm, I think they are supposed to include one or more square-bracketed
phrases that identify the source or "origin" of the error. Anyway, an
improved implementation is attached.

Regards

Blair

--------------------
!DBErrorDetails class methodsFor!

fromSQLError: aString
 "Answer an instance of the receiver built from the information in the
parameter aString."

 | lastBrkt |
 lastBrkt := aString lastIndexOf: $].
 ^self new
  msg: aString;
  origin: (aString copyFrom: 1 to: lastBrkt);
  yourself! !
!DBErrorDetails class categoriesFor: #fromSQLError:!instance
creation!public! !


Reply | Threaded
Open this post in threaded view
|

Re: DBWarning exception with Postgres ODBC driver.

Craig H. Anderson
Blair,
Thanks for the quick reply.
I will try your change as soon as I can,
in the meantime here are results from
a db open using the Access ODBC driver.


Microsoft Access Driver (*.mdb),  Version 4.00.371108,  Microsoft
Corporation, odbcjt32.dll, 4/24/99

======= Test code
dbc := DBConnection new.
dbc dsn: 'ConstraintsDB'.
dbc open.

======== Values from the debugger
dbCheckException: anIntegerRetCode
anIntegerRetCode is 1

fromSQLError: aString
aString is 'The driver returned invalid (or failed to return)
SQL_DRIVER_ODBC_VER: 03.51'


====== walkback follows:
10:55:04 AM, Sunday, January 07, 2001: 'Index 0 is out of bounds'
String(Object)>>errorSubscriptBounds:
String(Object)>>errorAt:
String>>at:
String>>replaceBytesOf:from:to:startingAt:
String>>replaceFrom:to:with:startingAt:
String(SequenceableCollection)>>copyFrom:to:
DBErrorDetails class>>fromSQLError:
DBExceptionDetails>>buildErrorInfo
DBWarning>>signal
DBWarning(Exception)>>signal:with:
DBWarning class(Exception class)>>signal:with:
DBWarning class(Exception class)>>signalWith:
DBConnection>>dbCheckException:
[] in DBConnection>>open
BlockClosure>>ifCurtailed:
DBConnection>>open
UndefinedObject>>{unbound}doIt
CompiledExpression>>value:
SmalltalkWorkspace>>evaluateRange:ifFail:debug:
SmalltalkWorkspace>>evaluateItIfFail:debug:
SmalltalkWorkspace>>evaluateItIfFail:
SmalltalkWorkspace>>evaluateIt
Symbol>>forwardTo:
[] in Command>>value
BlockClosure>>ensure:
Command>>value
SmalltalkWorkspaceDocument(Shell)>>performCommand:
CommandQuery>>perform
DelegatingCommandPolicy(CommandPolicy)>>route:
[] in ShellView(View)>>onCommand:
BlockClosure>>ensure:
Cursor>>showWhile:
ShellView(View)>>onCommand:
ShellView(View)>>wmCommand:wParam:lParam:
ShellView(View)>>dispatchMessage:wParam:lParam:
[] in InputState>>wndProc:message:wParam:lParam:cookie:
BlockClosure>>ifCurtailed:
ProcessorScheduler>>callback:evaluate:
InputState>>wndProc:message:wParam:lParam:cookie:
ShellView>>translateAccelerator:
ShellView>>preTranslateKeyboardInput:
ShellView(View)>>preTranslateMessage:
InputState>>preTranslateMessage:
InputState>>pumpMessage:
InputState>>loopWhile:
InputState>>mainLoop
[] in InputState>>forkMain
ExceptionHandler(ExceptionHandlerAbstract)>>markAndTry
[] in ExceptionHandler(ExceptionHandlerAbstract)>>try:
BlockClosure>>ensure:


===== ODBC log follows:

Dolphin         fffc0fff:fffd1ccb ENTER SQLAllocConnect
  HENV                0x0a220ad0
  HDBC *              0x081adca4

Dolphin         fffc0fff:fffd1ccb EXIT  SQLAllocConnect  with return code 0
(SQL_SUCCESS)
  HENV                0x0a220ad0
  HDBC *              0x081adca4 ( 0x0a220ef8)

Dolphin         fffc0fff:fffd1ccb ENTER SQLSetConnectOption
  HDBC                0x0a220ef8
  UWORD                      110
  UDWORD                     0

Dolphin         fffc0fff:fffd1ccb EXIT  SQLSetConnectOption  with return
code 0 (SQL_SUCCESS)
  HDBC                0x0a220ef8
  UWORD                      110
  UDWORD                     0

Dolphin         fffc0fff:fffd1ccb ENTER SQLDriverConnectW
  HDBC                0x0a220ef8
  HWND                0x0000026c
  WCHAR *             0x0a220fa8 [      -3] "DSN=ConstraintsDB"
  SWORD                       -3
  WCHAR *             0x0a121880
  SWORD                      510
  SWORD *             0x081adb34
  UWORD                        1 <SQL_DRIVER_COMPLETE>

Dolphin         fffc0fff:fffd1ccb EXIT  SQLDriverConnectW  with return code
1 (SQL_SUCCESS_WITH_INFO)
  HDBC                0x0a220ef8
  HWND                0x0000026c
  WCHAR *             0x0a220fa8 [      -3] "DSN=ConstraintsDB"
  SWORD                       -3
  WCHAR *             0x0a121880 [     107]
"DSN=ConstraintsDB;DBQ=D:\Data\ConstraintsDB.mdb;Drive"
  SWORD                      510
  SWORD *             0x081adb34 (107)
  UWORD                        1 <SQL_DRIVER_COMPLETE>

Dolphin         fffc0fff:fffd1ccb ENTER SQLError
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  UCHAR *             0x081b5c24 (NYI)
   SDWORD *            0x081ad66c
  UCHAR *             0x07e0c7f4
  SWORD                      512
  SWORD *             0x081ad76c

Dolphin         fffc0fff:fffd1ccb ENTER SQLErrorW
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  WCHAR *             0x0176f668 (NYI)
   SDWORD *            0x081ad66c
  WCHAR *             0x0176f674
  SWORD                     1024
  SWORD *             0x081ad76c

Dolphin         fffc0fff:fffd1ccb EXIT  SQLErrorW  with return code 0
(SQL_SUCCESS)
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  WCHAR *             0x0176f668 (NYI)
   SDWORD *            0x081ad66c (444)
  WCHAR *             0x0176f674 [     152] "The driver returned invalid (or
failed to return) SQL_DRIVER_ODBC_VER: 03.51"
  SWORD                     1024
  SWORD *             0x081ad76c (152)

Dolphin         fffc0fff:fffd1ccb EXIT  SQLError  with return code 0
(SQL_SUCCESS)
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  UCHAR *             0x081b5c24 (NYI)
   SDWORD *            0x081ad66c (444)
  UCHAR *             0x07e0c7f4 [      76] "The driver returned invalid (or
failed to return) SQL_DRIVER_ODBC_VER: 03.51"
  SWORD                      512
  SWORD *             0x081ad76c (76)

Dolphin         fffc0fff:fffd1ccb ENTER SQLFreeConnect
  HDBC                0x0a220ef8

Dolphin         fffc0fff:fffd1ccb EXIT  SQLFreeConnect  with return code -1
(SQL_ERROR)
  HDBC                0x0a220ef8

Dolphin         fffc0fff:fffd1ccb ENTER SQLError
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  UCHAR *             0x081b5c24 (NYI)
   SDWORD *            0x081ad76c
  UCHAR *             0x07dca644
  SWORD                      512
  SWORD *             0x081ad66c

Dolphin         fffc0fff:fffd1ccb ENTER SQLErrorW
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  WCHAR *             0x0176f668 (NYI)
   SDWORD *            0x081ad76c
  WCHAR *             0x0176f674
  SWORD                     1024
  SWORD *             0x081ad66c

Dolphin         fffc0fff:fffd1ccb EXIT  SQLErrorW  with return code 0
(SQL_SUCCESS)
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  WCHAR *             0x0176f668 (NYI)
   SDWORD *            0x081ad76c (0)
  WCHAR *             0x0176f674 [     112] "[Microsoft][ODBC Driver
Manager] Function sequence error"
  SWORD                     1024
  SWORD *             0x081ad66c (112)

Dolphin         fffc0fff:fffd1ccb EXIT  SQLError  with return code 0
(SQL_SUCCESS)
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  UCHAR *             0x081b5c24 (NYI)
   SDWORD *            0x081ad76c (0)
  UCHAR *             0x07dca644 [      56] "[Microsoft][ODBC Driver
Manager] Function sequence error"
  SWORD                      512
  SWORD *             0x081ad66c (56)

Dolphin         fffc0fff:fffd1ccb ENTER SQLError
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  UCHAR *             0x081b5c24 (NYI)
   SDWORD *            0x081ad76c
  UCHAR *             0x07dca644
  SWORD                      512
  SWORD *             0x081ad66c

Dolphin         fffc0fff:fffd1ccb ENTER SQLErrorW
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  WCHAR *             0x0176f668 (NYI)
   SDWORD *            0x081ad76c
  WCHAR *             0x0176f674
  SWORD                     1024
  SWORD *             0x081ad66c

Dolphin         fffc0fff:fffd1ccb EXIT  SQLErrorW  with return code 100
(SQL_NO_DATA_FOUND)
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  WCHAR *             0x0176f668 (NYI)
   SDWORD *            0x081ad76c
  WCHAR *             0x0176f674
  SWORD                     1024
  SWORD *             0x081ad66c

Dolphin         fffc0fff:fffd1ccb EXIT  SQLError  with return code 100
(SQL_NO_DATA_FOUND)
  HENV                0x0a220ad0
  HDBC                0x0a220ef8
  HSTMT               0x00000000
  UCHAR *             0x081b5c24 (NYI)
   SDWORD *            0x081ad76c
  UCHAR *             0x07dca644
  SWORD                      512
  SWORD *             0x081ad66c