stremer
(usa Arch Linux)
Enviado em 05/11/2008 - 19:49h
cara.... solução eu não tenho, mas ja vi problemas parecidos e meio que sei o "caminho das pedras" para resolver. Nunca implementei a solução, mas tem um texto (a la google) que tenho guardado aqui que pretendo um dia testar, mas vai seguir para você tentar resolver seu problema.
A grosso modo é mais ou menos assim... você tem uma dll que você joga la no wine que substituia a atual do windows para ODBC. Esta DLL ao invés de "conversar" com o ODBC do Windows vai conversar com um driver nativo do unix para acessar a base de dados. Para isto a aplicação deve fazer a conexão através de OBDC. A vantagem é que como o driver é nativo, você consegue maior performance. Além disso também você pode fazer umas "gambis" para instalar o OBDC e usar o próprio driver do windows. Não sei se pro SQL SERVER tem driver nativo, mas tem pra sybase e quase tudo é compativel.
Segue o texto, espero que ajude.
5.13.1. Using a Unix ODBC system with Wine
The first step in using a Unix ODBC system with Wine is, of course, to get the Unix ODBC system working itself. This may involve downloading code or RPMs etc. There are several Unix ODBC systems available; the one the author is used to is unixODBC (with the IBM DB2 driver). Typically such systems will include a tool, such as isql, which will allow you to access the data from the command line so that you can check that the system is working.
The next step is to hook the Unix ODBC library to the wine built-in odbc32 DLL. The built-in odbc32 (currently) looks to the environment variable LIB_ODBC_DRIVER_MANAGER for the name of the ODBC library. For example in the author's .bashrc file is the line:
export LIB_ODBC_DRIVER_MANAGER=/usr/lib/libodbc.so.1.0.0
If that environment variable is not set then it looks for a library called libodbc.so and so you can add a symbolic link to equate that to your own library. For example as root you could run the commands:
# ln -s libodbc.so.1.0.0 /usr/lib/libodbc.so
# /sbin/ldconfig
The last step in configuring this is to ensure that Wine is set up to run the built-in version of odbc32.dll, by modifying the DLL configuration. This built-in DLL merely acts as a stub between the calling code and the Unix ODBC library.
If you have any problems then you can use the debugmsg channel odbc32 to trace what is happening. One word of warning. Some programs actually cheat a little and bypass the ODBC library. For example the Crystal Reports engine goes to the registry to check on the DSN. The fix for this is documented at unixODBC's site where there is a section on using unixODBC with Wine.
5.13.2. Using Windows ODBC drivers
Native ODBC drivers have been reported to work for many types of databases including MSSQL and Oracle. In fact, some like MSSQL can only be accessed on Linux through a Winelib app. Rather than just copying DLL files, most ODBC drivers require a Windows-based installer to run to properly configure things such as registry keys.
In order to set up MSSQL support you will first need to download and run the mdac_typ.exe installer from microsoft.com. In order to configure your ODBC connections you must then run CLICONFG.EXE and ODBCAD32.EXE under Wine. You can find them in the windows\system directory after mdac_typ runs. Compare the output of these programs with the output on a native Windows machine. Some things, such as protocols, may be missing because they rely on being installed along with the operating system. If so, you may be able to copy missing functionality from an existing Windows installation as well as any registry values required. A native Windows installation configured to be used by Wine should work the same way it did when run natively.