Joshua Masiko escribió:
hello, I got your email addresses off the wine bug database at http://bugs.winehq.org/show_bug.cgi?id=6638. I'm looking at moving a custom Visual Basic 6 windows application to linux + wine.
However I cannot find any good step by step documentation on how to do this. I have SUSE 10, wine 0.9.29. I tried a simple test case which throws an error "ActiveX can't create object"
dim cn as adodb.connection set cn=new adodb.connection 'error on this statement
Can u give me any pointers on what i need in order to run a visual basic application which uses an ODBC DSN (postresql) and ADO>=2.5 successfully. I intend to publish a detailed step by step howto on this topic for other potential wine users if successfull
The very first step is to ensure ADO is actually installed in the Wine directory. Usually the MSVB6 installer for the application (created with the Package and Deployment Wizard) takes care of this, but installing MDAC 2.x works too (I have installed MDAC 2.8). Wine currently provides no replacements for ADO libraries or objects, so doing either of these options is mandatory.
It seems that you are trying to connect via ADO and ODBC. You should first have an Unix ODBC driver installed, since the ODBC support in Wine is simply a pass-through layer to the Unix ODBC support in the system. If you are compiling Wine from sources, you should (for example) have *both* unixODBC and unixODBC-devel RPM packages installed (or the equivalent bundles in SUSE). Otherwise, Wine will be compiled without ODBC support. You should then create (in unixODBC, not Wine) an ODBC data source for your database of choice, and verify (/usr/bin/isql) that you can actually connect and read data from it before trying to do anything from within Wine.
Also, please note that Wine (currently) only supports as much ODBC as the underlying ODBC support does. In particular, the following syntax:
Set oConexion = New ADODB.Connection
...
oConexion.Open ConnectionString:="Driver={Microsoft Access Driver (*.mdb)};DBQ=..."
in which the driver is specified within curly braces, is *NOT* supported under Wine, nor is any variation of this method. You must specify a data source that appears in your ODBC configuration file in /etc/odbc.ini .
Of course, you might just bypass the ODBC layer and do something like this:
Set oConexion = New ADODB.Connection
...
oConexion.Provider = "Microsoft.Jet.OLEDB.4.0" oConexion.Properties("Jet OLEDB:Database Password") =
"somepassword"
oConexion.Open ConnectionString:=App.Path & "\" & DATABASE_FILE
This method works as long as all the corresponding providers (which are also ActiveX objects) are correctly registered. In this way, no ODBC code is involved and the Windows code directly manages the database connection. However, all the necessary providers and drivers must be installed by your application installer (again, the Packaging and Deployment Wizard should take care of these dependencies).
Hope this helps.
Alex Villacís Lasso