Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODBC-Access on Windows 2012 does not work - E_FAIL #3671

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

ODBC-Access on Windows 2012 does not work - E_FAIL #3671

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2015-02-12 16:54:50 +0100
From: Dieter <>
To: clients devs <>
Version: 11.19.9 (Oct2014-SP2)
CC: @drstmane

Last updated: 2015-05-07 12:37:30 +0200

Comment 20655

Date: 2015-02-12 16:54:50 +0100
From: Dieter <>

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36
Build Identifier:

An error occurs when querying a table multiple times on the same ADO Connection object using a client side Cursor

ErrorCode: E_FAIL from Microsoft Cursor Engine

Error happens on operating system Windows 2012 Server.

MonetDB Database Server: CENTOS 7

The error doesn't occures on other ODBC drivers e.g MSSQL Server or Oracle
nor on older Windows OS versions.

Reproducible: Always

Steps to Reproduce:

  1. Create a Windows ODBC System DSN named 'MonetDB' user 'voc' password 'voc'

  2. Create a table in the catalog 'voc' like this and fill it:
    create table prices (currency char(3) , valid_from char(8), price decimal(15,2));
    insert into prices values('USD', '20130101' , 1.2);
    insert into prices values('USD', '20130201' , 1.3);
    insert into prices values('USD', '20111201' , 2.3);

  3. Execute the script which executes a query multiple times like this (VB-Script):

set con = CreateObject("ADODB.Connection")
conStr = "Provider='MSDASQL.1';Data Source='MonetDB';Initial Catalog='voc';"
'when comment following statement ado uses default server cursor -> works fine
'uncommenting following statement cause a E_FAIL in Microsoft Cursor Engine
'
con.CursorLocation = 3 'client side cursor
'
con.Open conStr, "voc", "voc"
set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = con
cmd.CommandType = 1 'text
cmd.CommandText = "select * from prices"
for i = 1 to 5
set rs = cmd.Execute(records, ,-1)
While not rs.EOF
rs.MoveNext
WEnd
rs.Close
set rs = nothing
next

Actual Results:

Error occurs with message "... Status E_FAIL" when executing the script/ select commands.

Expected Results:

Select and fetch of database records should be done without problems.

Test environment:

Operating System: Windows Server 2012 (using msado15.dll Version 6.2.9200 16384 which comes with Installation of the OS).

MonetDB ODBC Driver Version 11.19.09.01 32Bit or 64 Bit

Comment 20656

Date: 2015-02-12 16:58:13 +0100
From: Dieter <>

Created attachment 319
VB Script for testing database access on Windows 2012

Running this script results in an error on Windwos 2012.
On older Windows OS versions (Windows 2008, Windows 7) it works.

Attached file: monetQueryClientCursor.vbs (application/octet-stream, 1327 bytes)
Description: VB Script for testing database access on Windows 2012

Comment 20671

Date: 2015-02-24 10:15:24 +0100
From: @sjoerdmullender

I don't have access to Windows 2012 (or Windows 8), so it's hard for me to reproduce. What might help is some debug output from the MonetDB ODBC driver.

Can you please create a log (see below) and attach it to this bug report.

To create a log, you need to start the application that uses the MonetDB ODBC driver with an extra environment variable. Probably the easiest way to do that is to start a cmd window (Start -> Run... -> cmd.exe) and in that window type

set ODBCDEBUG=C:....\odbc.log

and then start your application from this window.
The bit after the = should be the absolute pathname of a file you can write to. After the application is done it should contain a log of the complete interaction with the driver. Before attaching the file, please make sure it doesn't contain any sensitive information.

Instead of attaching, you can also send the file directly to me.

Comment 20672

Date: 2015-02-24 16:41:23 +0100
From: Dieter <>

Created attachment 323
odbc.log

The last "select * from Prices" is the command wich results the error

Attached file: odbc.log (application/octet-stream, 46993 bytes)
Description: odbc.log

Comment 20673

Date: 2015-02-25 15:37:27 +0100
From: MonetDB Mercurial Repository <>

Changeset 48623d9c99c9 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=48623d9c99c9

Changeset description:

32/64 bit fixes to the ODBC driver.
It turns out that current documentation on ODBC on msdn.microsoft.com
specify when to use 32 and 64 bits in the interface.  That wasn't
always the case.
This should fix bug #3671.

Comment 20674

Date: 2015-02-25 20:30:45 +0100
From: Dieter <>

Thanks for your engagement on this issue.

Can you provide a compiled Version of the corrected ODBC.dll or whatever I need to test the corrected version as download for my 32bit/64bit Windows - Plattforms. I'd like to test it in my environment and I'll give you a Feedback.

Dieter

Comment 20675

Date: 2015-02-25 20:37:26 +0100
From: @drstmane

Dieter,

you'll find nightly built installers later tonight / tomorrow morning via our 'TestWeb" (http://monetdb.cwi.nl/testweb/web/status.php) under http://monetdb.cwi.nl/testweb/web/54807:48623d9c99c9/

Stefan

Comment 20681

Date: 2015-03-02 17:58:45 +0100
From: Dieter <>

I have tested the nightly build ODBC installers (.msi) from today.

The problem is not solved with your changes.

Comment 20691

Date: 2015-03-05 15:02:21 +0100
From: Dieter <>

Hi Sjoerd,

you've written, that you don't have access to a Windows 2012/Windows 8 system.
If it helps you, I can provide a Windows 8 virtual system (about 15GB),
which you can run using a VMWare player (cost free). It's a Microsoft Developer license which you could use only for this bug issue.
If you need this VMWare file, i would sent you a download link to your personal email address.
Please let me know the further steps.

Dieter

Comment 20693

Date: 2015-03-06 09:54:49 +0100
From: @sjoerdmullender

I now do have access to a Windows 2012 virtual machine. I was able to download one from Microsoft that I can use for 180 days.
Using it, I can indeed reproduce the problem.
However, I can't currently think of anything else I could try to fix the problem. My problem is, using the debug option in the MonetDB ODBC driver and the trace option in the ODBC Driver Manager, I can't see anything strange happening. When the error occurs, I can see only one call to SQLExtendedFetch instead of three (one for each row in the query result). However, I don't see any errors happening there. It is as if the application just decided one is enough. Without access to any more information about what the application (the VisualBasic interpreter) is doing, it is very hard to figure out why the error is happening.
Is there any trace facility in VB? Is there source code available of the relevant part of the VB interpreter?

Comment 20695

Date: 2015-03-06 13:01:43 +0100
From: Dieter <>

Hi Sjoerd,

with Windows 8/Sever2012 there is a new tracetool available using powershell commands. See Data Access Tracing in Windows 8
https://msdn.microsoft.com/en-us/library/hh829624(v=vs.85).aspx
Perhaps this may help you.

I also developed a small Windows console program in Visual C++ (odbctest.exe) which do a select against the database like the VBscript does.
I packed the source code and Visual Studio project files in a zip file. Because it uses VC runtime dll's and only release builds
for that dlls are distributed with the operation system, the release build of the testprogam has compiler optimizations disabled but generates
a program database file for debugging.

Comment 20696

Date: 2015-03-06 13:05:09 +0100
From: Dieter <>

Created attachment 324
ODBC Testprogramm in C with Visual Studio project

for testing with a c programm (alternative to the VBscript)

Attached file: odbctest.zip (application/x-zip-compressed, 72282 bytes)
Description: ODBC Testprogramm in C with Visual Studio project

Comment 20698

Date: 2015-03-09 17:20:23 +0100
From: MonetDB Mercurial Repository <>

Changeset 9eed5049e02a made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=9eed5049e02a

Changeset description:

The RowStatusArray pointer in SQLExtendedFetch replace the *I*RD status ptr.
I think this fixes bug #3671.

Comment 20703

Date: 2015-03-11 10:53:16 +0100
From: Dieter <>

Hi Sjoerd,
with your changes the problem seems to fixed.
My first test on Windows 2012 was successful.
Thanks for your precious engangement.

Dieter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant