Mdac error running custom query against MSSQL - Linux w/wine 4.0 32 bit prefix

zootal posted 2 months ago in General

Linux: Slackware current, 64 bit, 4.19.18 kernel. Wine version 4.0 32 bit clean prefix with nothing installed but mdac28 (cause Heidisql won't talk to mssql server at all without that).

This is a variation on the mdac problem with MSSQL server. I can setup the server just fine:

Network type: Microsoft SQL Server (TCP/IP)

I can open it, I see my databases, I see the tables. I can click on a table, click the data tab, and see my data. This works. Heidisql is obviously accessing the SQL server and retrieving data. I can even update data by typing the updates into the data grid.

If I select the Query tab and type in a custom query, just something simple like select * from <some table>, an error occurs:

exception number : 1 exception class : EDatabaseError exception message : Recordset is not open.

main thread ($9): 0084556a heidisql32.r5473.exe Data.DB DatabaseError 7eab02e5 user32.dll DispatchMessageW 7eae759e user32.dll GetParent 7b42ba79 KERNEL32.dll GlobalFindAtomW

And you get the message about installing mdac28, which is already installed.

ansgar posted 2 months ago

Did you then install native_mdac as well?

Here's what Heidi suggests in such cases:

chmod +x winetricks
sh winetricks mdac28
sh winetricks native_mdac
zootal posted 2 months ago

Yes, I did exactly that. Tested in clean 32 and 64 bit prefixes.

What is weird is that Heidisql can access the server just fine, it is only when running a custom query that the problem occurs. I'm not sure what is different behind the scenes.

I'm using the "current" level of Slackware, I'm wondering if I have a bleeding edge lib that is causing this?

I'm also using the latest wine version, I think I'll try an older wine and see if maybe the wine devs broke something. I'm kinda leaning towards this being a wine/lib problem, not a Heidi problem, but thought ask in case anyone else is seeing this.

zootal posted 2 months ago

TAADAA I went back to an older wine version, and it works. I was right about something in newer wine breaking this. I'll play with this some more and see if I can identify the wine version where it breaks, I'm betting it was the 3.x to 4.0 transition. I'll report back here what I find.

zootal posted 2 months ago

I tried versions of wine going back to 3.0. It appears this was broken back with wine 3.15. It works in prior versions.

With wine 3.15 through wine 3.21, Heidisql crashes just opening a connection to an MSSQL server. This apparently was fixed in wine 4.0, but they introduced the problem where custom queries causes an error.

I'm going to post a bug report with wine, and see where that goes.

zootal posted 2 months ago

zootal posted 2 months ago

This has been fixed in Wine 4.2. For those that can't wait for wine 4.2 to be released, you can get the patches from the bug page listed above and patch the 4.1 source code and recompile wine yourself.

ansgar posted 2 months ago

Hey, thanks for your consistent feedback on that issue. Should I probably place an additional note about Wine 4.2 on the download page?

zootal posted 2 months ago

Would probably be a good idea, especially since the current version of wine is 4.1, which is broken. Wine 4.2 has not yet been released, and while I don't now when it will be, I expect it within the week.

Maybe warn people using MSSQL to use wine 3.14 until Wine 4.2 comes out or something like that? I can download patches from the bug site, patch and compile wine, but not everyone that uses Heidi knows how to do that.

ansgar posted 2 months ago

Just done so.

zootal posted 2 months ago

That looks perfect, by the way. Thank you!

Please login to leave a reply, or register at first.