WINE + MSSQL 2000 + VB6 -> Numbers are rounded in records

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Razorwings18
Level 2
Level 2
Posts: 14
Joined: Fri Jan 08, 2010 3:19 pm

WINE + MSSQL 2000 + VB6 -> Numbers are rounded in records

Post by Razorwings18 »

Hi all,

I've got a "straightforward" database querying problem with a Visual Basic 6 application that happens on Debian (+WINE), but not on Windows XP.

SETUP:
* COMPUTER "FREE" with:
--- DEBIAN Lenny (Lang: Spanish)
--- unixODBC + FreeTDS for ODBC conectivity to remote MSSQL2000 (tested, working)
--- WINE 1.1.33
--- MDAC 2.8 (for channelling the ODBC connection through to unixODBC)

* COMPUTER "M$" with:
--- Windows XP (Lang: Spanish)
--- MSSQL Server 2000
--- MDAC 2.8

PROBLEM:
I create an ODBC connection to MSSQL2000 on VB6, and query a field (Numeric 9,2) into an ADODB.Recordset.
On Windows, the program returns the complete field numeric value (2.44), but on Debian it rounds the number (2.00).

On Debian, channelling the Query through isql properly returns 2.44, so it's most likely a WINE or VB6+WINE issue.

LITTLE VB6 TEST PROGRAM CODE (returns 2.44 on Windows XP, but 2.00 on Debian):

Code: Select all

Private oConn As ADODB.Connection

Private Sub Command1_Click()
    Dim oRS As ADODB.Recordset
    
    Set oConn = New ADODB.Connection
    oConn.Open "DSN=myODBCDSN; UID=username; PWD=password;"
        
    Set oRS = New ADODB.Recordset
    
    oRS.Open "SELECT Price FROM GOODS WHERE idGoods = 10", oConn, adOpenDynamic
    MsgBox oRS("Price")
    
    oConn.Close
    Set oRS = Nothing
    Set oConn = Nothing
End Sub
The line oRS("Price") is where the problem is.

Any pointers will be most welcome.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: WINE + MSSQL 2000 + VB6 -> Numbers are rounded in rec

Post by vitamin »

Razorwings18 wrote:I create an ODBC connection to MSSQL2000 on VB6, and query a field (Numeric 9,2) into an ADODB.Recordset.
On Windows, the program returns the complete field numeric value (2.44), but on Debian it rounds the number (2.00).
Try native oleaut32.dll.
Razorwings18
Level 2
Level 2
Posts: 14
Joined: Fri Jan 08, 2010 3:19 pm

Post by Razorwings18 »

Thank you for your reply. Actually, odbccp32 and oleaut32 are set to "native, builtin". odbc32 is set to "builtin", since otherwise it won't map the ODBC connection to unixODBC (which sounds logical IMHO).

Sorry for skipping this info in my original post.
savelov
Level 2
Level 2
Posts: 46
Joined: Sun Jan 10, 2010 5:46 am

native oleaut32

Post by savelov »

Razorwings18,

I think you need to download native oleaut32.dll (or copy from windows xp) and install it manually, as MDAC28 does not contain this dll. (I did not observe any changes to this dll after installation of mdac28 on my wine )
Razorwings18
Level 2
Level 2
Posts: 14
Joined: Fri Jan 08, 2010 3:19 pm

Re: native oleaut32

Post by Razorwings18 »

savelov wrote:Razorwings18,

I think you need to download native oleaut32.dll (or copy from windows xp) and install it manually, as MDAC28 does not contain this dll. (I did not observe any changes to this dll after installation of mdac28 on my wine )
Ah, you do have a point there. I checked the MDAC28 manifest (http://support.microsoft.com/?kbid=828396) and indeed MDAC28 does not include oleaut32.dll .

Thanks! I'll get the native dll and see if it works.
Razorwings18
Level 2
Level 2
Posts: 14
Joined: Fri Jan 08, 2010 3:19 pm

Post by Razorwings18 »

I noticed oleaut32.dll is distributed with VB6 Runtime Libraries, which I had previously installed. I reinstalled them via Winetricks both set as Builtin and native and there was no change unfortunately.

I also fiddled with all Library Native/Builtin settings to see if anything changed, but the problem remains.
Razorwings18
Level 2
Level 2
Posts: 14
Joined: Fri Jan 08, 2010 3:19 pm

Post by Razorwings18 »

In WINE 1.1.35, native OLE DB support was added. Since I could not find a solution using ODBC, I switched to a OLE DB DSN-Less connection taking advantage of this brand new feature and tried again. It worked!

I could not find why ODBC gave me this problem, and now I can remain happily ignorant [hopefully]. :lol:

Thank you all for your suggestions.
Razorwings18
Level 2
Level 2
Posts: 14
Joined: Fri Jan 08, 2010 3:19 pm

Post by Razorwings18 »

In WINE 1.1.35, native OLE DB support was added. Since I could not find a solution using ODBC, I switched to a OLE DB DSN-Less connection taking advantage of this brand new feature and tried again. It worked!

I could not find why ODBC gave me this problem, and now I can remain happily ignorant [hopefully]. :lol:

Thank you all for your suggestions.
Locked