[squeak-dev] FFI + ODBC problems

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

[squeak-dev] FFI + ODBC problems

riccardo.sangalli
Hello,
sorry for my english and for annoying you, but I have a question about FFI...
I am a newbie in smalltalk and I tried to use Seaside to make an ODBC connection.
So we tryied to make a simple connection + query:
 
| con |
  con := ODBCConnection dsn:'testsqueak' user:'sa' password:''.
  (con query: 'SELECT count(*) FROM Clienti') results do:[:row | Transcript show: row; cr].
 
  con close.
 
...but we obtained the error explained in the attachment image file.
We use Squeak 3.9 (Seaside OneClickExperience version) + FFI loaded by Squeak Map +
ODBC for Squeak loaded with Squeak Map.
Running that code in an old version of Squeak (3.7) everithing works...
Do you know why?
Maybe that are different versions of FFI?
Maybe the call at odbc32.dll OLD deprecated function "SQLAllocEnv" instead of new "SQLAllocHandle"?
 
Thank you a lot in advance and best wishes for holidays.


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] FFI + ODBC problems

Mariano Martinez Peck
I see no attachment. Can we attach files in this list ?


On Mon, Dec 22, 2008 at 3:37 PM, <[hidden email]> wrote:
Hello,
sorry for my english and for annoying you, but I have a question about FFI...
I am a newbie in smalltalk and I tried to use Seaside to make an ODBC connection.
So we tryied to make a simple connection + query:
 
| con |
  con := ODBCConnection dsn:'testsqueak' user:'sa' password:''.
  (con query: 'SELECT count(*) FROM Clienti') results do:[:row | Transcript show: row; cr].
 
  con close.
 
...but we obtained the error explained in the attachment image file.
We use Squeak 3.9 (Seaside OneClickExperience version) + FFI loaded by Squeak Map +
ODBC for Squeak loaded with Squeak Map.
Running that code in an old version of Squeak (3.7) everithing works...
Do you know why?
Maybe that are different versions of FFI?
Maybe the call at odbc32.dll OLD deprecated function "SQLAllocEnv" instead of new "SQLAllocHandle"?
 
Thank you a lot in advance and best wishes for holidays.






Reply | Threaded
Open this post in threaded view
|

RE: [squeak-dev] FFI + ODBC problems

Ramon Leon-5
In reply to this post by riccardo.sangalli
> Hello,
> sorry for my english and for annoying you, but I have a
> question about FFI...
> I am a newbie in smalltalk and I tried to use Seaside to make
> an ODBC connection.
> So we tryied to make a simple connection + query:
>  
> | con |
>   con := ODBCConnection dsn:'testsqueak' user:'sa' password:''.
>   (con query: 'SELECT count(*) FROM Clienti') results
> do:[:row | Transcript show: row; cr].
>  
>   con close.
>  
> ...but we obtained the error explained in the attachment image file.
> We use Squeak 3.9 (Seaside OneClickExperience version) + FFI
> loaded by Squeak Map +
> ODBC for Squeak loaded with Squeak Map.
> Running that code in an old version of Squeak (3.7)
> everithing works...
> Do you know why?
> Maybe that are different versions of FFI?
> Maybe the call at odbc32.dll OLD deprecated function
> "SQLAllocEnv" instead of new "SQLAllocHandle"?
>  
> Thank you a lot in advance and best wishes for holidays.

The ODBC on squeakmap is outdated, get the latest one from squeaksource
that's been fixed up and packaged with monticello.

Ramon Leon
http://onsmalltalk.com


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: FFI + ODBC problems

Andreas.Raab
In reply to this post by riccardo.sangalli
Hi Riccardo -

[Note: Riccardo had sent me a screen shot off-list]
First thing to note here is that whenever you have an error like this
you should make a copy of SqueakDebug.log (which gets created upon
failure) and attach this to the message. It cuts down on size since
instead of having to make and crop a screenshot of the debugger you can
just paste the report into your email client.

The interesting bit about this call stack is the that the last line says:

AnObsoleteExternalFunction class>>doesNotUnderstand: #getLastError

which means that somewhere the installation of the FFI went wrong. From
what it looks like you might have installed the FFI, then ODBC, then
unloaded the FFI again (and maybe tried to load it once more ;-) Or
something along these lines.

As a consequence the ODBC code refers to an obsolete class and fails. To
fix this, you need to ensure that you have the FFI loaded properly (run
the FFITester examples to make sure everything is in a proper state) and
then you need to recompile the ODBC package (if you are using Monticello
you can do this from the context menu). This should fix it.

Cheers,
   - Andreas

[hidden email] wrote:

> Hello,
> sorry for my english and for annoying you, but I have a question about
> FFI...
> I am a newbie in smalltalk and I tried to use Seaside to make an ODBC
> connection.
> So we tryied to make a simple connection + query:
>  
> | con |
>   con := ODBCConnection dsn:'testsqueak' user:'sa' password:''.
>   (con query: 'SELECT count(*) FROM Clienti') results do:[:row |
> Transcript show: row; cr].
>  
>   con close.
>  
> ...but we obtained the error explained in the attachment image file.
> We use Squeak 3.9 (Seaside OneClickExperience version) + FFI loaded by
> Squeak Map +
> ODBC for Squeak loaded with Squeak Map.
> Running that code in an old version of Squeak (3.7) everithing works...
> Do you know why?
> Maybe that are different versions of FFI?
> Maybe the call at odbc32.dll *OLD deprecated* function "*SQLAllocEnv*"
> instead of new "*SQLAllocHandle*"?
>  
> Thank you a lot in advance and best wishes for holidays.
>
>
> ------------------------------------------------------------------------
>
>