StartTransaction raise EODBCError

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
hendrang
Posts: 6
Joined: Mon 28 Sep 2009 17:12

StartTransaction raise EODBCError

Post by hendrang » Mon 28 Sep 2009 17:22

Hi,
I am using Unidac to connect to Microsoft Access database.

why UniConnection1.StartTransaction always raise an error with message
"[Microsoft] [ODBC Microsoft Access Driver] Attribute cannot be set now'

hendrang
Posts: 6
Joined: Mon 28 Sep 2009 17:12

Re: StartTransaction raise EODBCError

Post by hendrang » Tue 29 Sep 2009 05:50

hendrang wrote:Hi,
I am using Unidac to connect to Microsoft Access database.

why UniConnection1.StartTransaction always raise an error with message
"[Microsoft] [ODBC Microsoft Access Driver] Attribute cannot be set now'
I find out that if I set indexfieldnames value to any fieldname, the error message not raises anymore, is it the problem solver ?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 29 Sep 2009 08:57

You cannot start transaction when you have a dataset that is not fully fetched.

Set the FetchAll specific option to True to resolve the problem.

We'll change the default value of FetchAll to True in the next UniDAC build.

tobias_cd
Posts: 56
Joined: Thu 18 Dec 2008 22:10

Post by tobias_cd » Tue 29 Sep 2009 12:14

Plash wrote:We'll change the default value of FetchAll to True in the next UniDAC build.
Plash,
please only change the default for the Access provider if necessary, not Oracle or SQL Server which would cause huge problems with existing code dependent on that behavior, thank you.
Regards,
Tobias

hendrang
Posts: 6
Joined: Mon 28 Sep 2009 17:12

Post by hendrang » Tue 29 Sep 2009 13:36

tobias_cd wrote:
Plash wrote:We'll change the default value of FetchAll to True in the next UniDAC build.
Plash,
please only change the default for the Access provider if necessary, not Oracle or SQL Server which would cause huge problems with existing code dependent on that behavior, thank you.
Regards,
Tobias
Hi Plash,
Thanks for reply.

It is strange that after I set fetchAll to true, I run the application, and then I set fetchAll to false, my application run smoothly. even now if I create new application without set fetchall to true, the error message does not raise anymore. Its really happen. :oops:
I don't like the idea to set fetchAll to true either because it will be performance problem.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 30 Sep 2009 07:52

Dataset can be fully fetched even if FetchAll = False. This can occur in the following cases:
- records count is less than a value of the FetchRows property;
- you manually scroll the dataset to the end;
- the IndexFieldsNames property is set.

hendrang
Posts: 6
Joined: Mon 28 Sep 2009 17:12

Post by hendrang » Wed 30 Sep 2009 08:35

Plash wrote:Dataset can be fully fetched even if FetchAll = False. This can occur in the following cases:
- records count is less than a value of the FetchRows property;
- you manually scroll the dataset to the end;
- the IndexFieldsNames property is set.
Yes sir, The error raises again if I test with larger data. That mean I could not avoid set fetchall to true. :lol:
Thanks for your info.

Post Reply