ODBC call failure in SDL

Discussions related to database technologies, file handling, directories and storage
joecurtis
Posts: 1
Joined: Wed 11 Apr 2018, 11:46

ODBC call failure in SDL

Post by joecurtis »

The statement 'sys "LoadLibrary", "ODBC32.DLL" ¸to odbc%' works with BB4W but with BBCSDL2.0 gives me a ' No such system call' error.
Can anyone suggest a reason?
RichardRussell

Re: ODBC call failure in SDL

Post by RichardRussell »

joecurtis wrote: Sat 29 Feb 2020, 18:56 The statement 'sys "LoadLibrary", "ODBC32.DLL" ¸to odbc%' works with BB4W but with BBCSDL2.0 gives me a ' No such system call' error.
I do not recommend trying to call Windows API functions from BBCSDL (remember that SDL2 is acting as an 'OS abstraction layer' and is partially isolating your program from Windows). However you may find it works by using LoadLibraryA:

Code: Select all

      SYS "LoadLibraryA", "ODBC32.DLL" TO odbc%
Really you should be calling the equivalent SDL2 function instead:

Code: Select all

      SYS "SDL_LoadObject", "C:\Windows\SysWOW64\odbc32.dll" TO odbc%
But you would then need to be consistent and use only SDL functions throughout.