Page 1 of 1

USE `mysql` fails when Unidirectional?

Posted: Mon 02 Jan 2006 11:22
by upscene
Hi there,

I'm executing these (separately) in sequence:
use `mysql`
select * from user

on a connection WITHOUT selecting a database and execute them in a TMyQuery component.

If Unidirectional and ReadOnly are FALSE, this works fine. However, when these are TRUE, it fails with:

#3D000No database selected


Any idea why?

--
Martijn Tonies
Upscene Productions

Posted: Wed 04 Jan 2006 10:32
by Ikar
MyDAC automatically sets FetchAll to False after setting Unidirectional to True. To execute FetchAll = False statements MyDAC creates additional connections. As a result, for executing SELECT and USE statements two different connections to server are used.

Posted: Wed 04 Jan 2006 10:35
by upscene
But apparently only when executing a SELECT, cause the USE statement is executed in the primary connection??

--
Martijn Tonies
Upscene Productions

Posted: Wed 04 Jan 2006 14:39
by Ikar
Currently MyDAC doesn't use complicated algorithms to analyze necessity of creating additional connections. Now we do not have in plans to improve this behavior.