error with DBConnection>>open

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

error with DBConnection>>open

Ted Shen-3
I would like to connect to an Oracle database via ODBC, using VPN.  I used
DBConnection>>open, and after choosing the DSN name and entering my
password, I got a walkback 'Index 434 is out of bounds'.  This error occurs
in the last line of DBConnection>>open, where it says

self connectString: (connSz copyFrom: 1 to: lenConnSz value)

and here lenConnSz value is 434.

Any idea why lenConnSz value is 434, and why it's apparently too big?

Thanks.


Reply | Threaded
Open this post in threaded view
|

Re: error with DBConnection>>open

Christopher J. Demers
"Ted Shen" <[hidden email]> wrote in message
news:1065455947.326670@rh9cache...
> I would like to connect to an Oracle database via ODBC, using VPN.  I used
> DBConnection>>open, and after choosing the DSN name and entering my
> password, I got a walkback 'Index 434 is out of bounds'.  This error
occurs
> in the last line of DBConnection>>open, where it says
>
> self connectString: (connSz copyFrom: 1 to: lenConnSz value)
>
> and here lenConnSz value is 434.
>
> Any idea why lenConnSz value is 434, and why it's apparently too big?

Working with Oracle in Dolphin is "fun", but just Oracle on its own is so
much "fun".  I just increased the size of the connection string buffer.  I
also had to add code to strip nulls as well.  You can see my
DBConnection<<open method bellow.  You can do a http://groups.google.com
search restricted to this group with Oracle as a search term to find some
other Oracle issues.

==================
open
"Open the receiver after prompting for the connection details, but only
if not already connected."
"cdemers - 7/16/2003 Increased conSz size to 500 from 256."
handle isNull
ifTrue:
[| connSz lenConnSz |
[| ret |
connSz := String new: 500"256".
lenConnSz := SWORD new.
ret := ODBCLibrary default
sqlDriverConnect: self getHandle
windowHandle: UserLibrary default getActiveWindow
inConnectionString: self connectString
stringLength1: SQL_NTS
outConnectionString: connSz
bufferLength: connSz size
stringLength2Ptr: lenConnSz
driverCompletion: (self useDriverCompletion
ifTrue: [SQL_DRIVER_COMPLETE]
ifFalse: [SQL_DRIVER_NOPROMPT]).
self dbCheckException: ret]
ifCurtailed: [self free].
self connectString: (connSz copyFrom: 1 to: lenConnSz value) trimNulls
"cdemers - 8/4/2003 Added"]
==================

Chris


Reply | Threaded
Open this post in threaded view
|

Re: error with DBConnection>>open

Ted Shen-3
Thanks, Chris.  This is working well.

Ted

"Christopher J. Demers" <[hidden email]> wrote in
message news:blsj37$fio80$[hidden email]...
> "Ted Shen" <[hidden email]> wrote in message
> news:1065455947.326670@rh9cache...
> > I would like to connect to an Oracle database via ODBC, using VPN.  I
used

> > DBConnection>>open, and after choosing the DSN name and entering my
> > password, I got a walkback 'Index 434 is out of bounds'.  This error
> occurs
> > in the last line of DBConnection>>open, where it says
> >
> > self connectString: (connSz copyFrom: 1 to: lenConnSz value)
> >
> > and here lenConnSz value is 434.
> >
> > Any idea why lenConnSz value is 434, and why it's apparently too big?
>
> Working with Oracle in Dolphin is "fun", but just Oracle on its own is so
> much "fun".  I just increased the size of the connection string buffer.  I
> also had to add code to strip nulls as well.  You can see my
> DBConnection<<open method bellow.  You can do a http://groups.google.com
> search restricted to this group with Oracle as a search term to find some
> other Oracle issues.
>
> ==================
> open
> "Open the receiver after prompting for the connection details, but only
> if not already connected."
> "cdemers - 7/16/2003 Increased conSz size to 500 from 256."
> handle isNull
> ifTrue:
> [| connSz lenConnSz |
> [| ret |
> connSz := String new: 500"256".
> lenConnSz := SWORD new.
> ret := ODBCLibrary default
> sqlDriverConnect: self getHandle
> windowHandle: UserLibrary default getActiveWindow
> inConnectionString: self connectString
> stringLength1: SQL_NTS
> outConnectionString: connSz
> bufferLength: connSz size
> stringLength2Ptr: lenConnSz
> driverCompletion: (self useDriverCompletion
> ifTrue: [SQL_DRIVER_COMPLETE]
> ifFalse: [SQL_DRIVER_NOPROMPT]).
> self dbCheckException: ret]
> ifCurtailed: [self free].
> self connectString: (connSz copyFrom: 1 to: lenConnSz value) trimNulls
> "cdemers - 8/4/2003 Added"]
> ==================
>
> Chris
>
>