[ODBC-192] ODBC 3.0.6 VBA Error on Query Created: 2018-10-19  Updated: 2023-09-07  Resolved: 2018-10-31

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.0.6
Fix Version/s: 3.0.7, 2.0.19, 3.1.0

Type: Bug Priority: Major
Reporter: Marcel Krausert Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Environment:

EXCEL 2016, MariaDB 10.3.8


Attachments: File dbTest.bas    
Issue Links:
Blocks
is blocked by ODBC-396 Classic asp recordcount not working Closed

 Description   

I downloaded and installed the MariaDB ODBC Driver 3.0.6 and installed it on my computer. Then I wrote a small piece of VBA in EXCEL 2016 which connects to the DB, which seems to work, and tries to query some entries.

Here is where the problems start:

  • The recordset allways returns a RecordCount of -1
  • If I use CursorLocation adUseClient instead of asUseServer VBA throws the following error: Runtime error '-2147467259 (80004005)' ... returned Status E_FAIL

As soon as I install Connector 3.0.5 everything works fine!

Code snippet attached.



 Comments   
Comment by Lawrin Novitsky [ 2018-10-19 ]

Thank you for your report.

Do you mean that with 3.0.5 RecordCount wasn't -1?

Comment by Lawrin Novitsky [ 2018-10-19 ]

Also, could you please provide your table structure. I tried your code with arbitrary table, and could not re-create the problems you described

Comment by Marcel Krausert [ 2018-10-20 ]

With 3.0.6 using adUseServer -> Record Count -1
With 3.0.5 using adUseServer -> Record Count -1

Same behaviour, might be correct, I'm not that deep into the stuff...

With 3.0.6 using adUseClient -> E_FAIL Error
With 3.0.5 using adUseClient -> Works fine -> Record Count > 0 and I get valid Data from Table

I will post the Table structure later!

Comment by Marcel Krausert [ 2018-10-20 ]

CREATE TABLE IF NOT EXISTS `myTable`
(
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`StartTime` DATETIME NOT NULL,
`Duration` TIME NOT NULL,
`Shift` VARCHAR(32) NULL DEFAULT '',
`Job` VARCHAR(80) NULL DEFAULT '',
`ProductID` INT(10) NULL DEFAULT '0',
`Product` VARCHAR(50) NULL DEFAULT '',
`NPR` FLOAT NULL DEFAULT '0',
`State` TINYINT(4) NOT NULL, e.g. Sched DT',
`StopCode` VARCHAR(20) NULL DEFAULT '',
`StopDescription` VARCHAR(80) NULL DEFAULT '',
`MachineCode` VARCHAR(20) NULL DEFAULT '',
`MachineDescription` VARCHAR(32) NULL DEFAULT '',
`ProductCounter` INT(10) UNSIGNED NULL DEFAULT '0',
`RejectCounter` INT(10) UNSIGNED NULL DEFAULT '0',
`AdditionalRejects` INT(10) NULL DEFAULT '0',
`OpComment` VARCHAR(32) NULL DEFAULT '',
`Acknowledged` TINYINT(4) UNSIGNED NULL DEFAULT '0',
`SerialNr` VARCHAR(15) NULL DEFAULT '',
PRIMARY KEY (`id`)
)
COMMENT='...'
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
ROW_FORMAT=COMPACT

Comment by Lawrin Novitsky [ 2018-10-23 ]

Thanks, I could get the error using your table definition. Next step is to fix it.

Generated at Thu Feb 08 03:26:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.