WINE+Sistema em Delphi 7+MS SQL SERVER

1. WINE+Sistema em Delphi 7+MS SQL SERVER

William Forti Bueno
ventrue.w

(usa Debian)

Enviado em 05/11/2008 - 12:36h

Ola,

Estou com um problema para emular alguns aplicativos criados em Delphi 7 que acessam um banco de dados MS SQL SERVER 2000. Quando tento emular ele da a seguinte menssagem de erro:

"Exception Exception in module NomedoAplicativo.exe at 0009EEC7.
Erro criando objeto. Favor verificar se o Microsoft Data Access Components 2.1 (ou superior) foi instalado adequadamente."

Mas se o aplicativo não tiver o acesso ao Banco de dados, ele emula e roda normalmente.
Ja intalei o MDAC 2.1 ja tentei o 2.7 via WINE mesmo e ambos instalaram corretamente, mas mesmo assim o aplicativo da o mesmo erro.

Se alguem aqui ja tiver passado por esse problema e que conseguiu rersolver puder me dar uma ajuda, eu agradeço.

Obrigado



  


2. ae

João Marcos Menezes
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.



3. ah

João Marcos Menezes
stremer

(usa Arch Linux)

Enviado em 05/11/2008 - 19:54h

ps: quando me refiro a "jogar a dll" é na verdade configurar todo o "esquema" para ele "falar" com a lib nativa.
Quanto a instalar os drivers para o linux, tem diversos tutos para isso, para configurar o ODBC no linux, etc.
Boa sorte e posta ai a resposta dizendo se deu certo.
Abs


4. Re: WINE+Sistema em Delphi 7+MS SQL SERVER

Rogério Cassimiro
cassimirinho

(usa Ubuntu)

Enviado em 05/11/2008 - 20:28h

Tenho uma aplicação também em delphi com firebird, mas não consegui fazer funcionar.


5. ODBC

William Forti Bueno
ventrue.w

(usa Debian)

Enviado em 07/11/2008 - 15:44h

Seguindo o post do Stremer consegui fazer o ODBC reconhecer meu banco de bados, porem o mesmo so reconheceu o banco MASTER do MS SQL SERVER.. ainda estou quebrando a cabeça para faze-lo reconhecer as tabelas corretas para o funcionamento do sistema...








Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts