Re: Weird error accessing to ADO components

Arnau Font wrote:

Hi, I'm executing some TADOQueries in a multithread environment, and
I get the error:
'La operacisn no se puede realizar mientras se ejecuta

I'll try to translate it to English:
'The operation cannot be executed while it is running asychronously'

Why do I get this error? Should I lock the TAdoConnection with a


Yes, you should make your ADO objects thread-safe

critical sections are not the best option since they are good for very
fast executing code, but not for database ops, which are relatively

I would suggest one of 3 approaches:

- use messages
- create a TThread descendant which has its own TADOConnection (or
whatever objects you need)
- data connection pooling (about this i do not know much)

Good luck
Best regards :)

Guillem Vicens Meier
Dep. Informatica Green Service S.A.
Contribute to the Indy Docs project:
In order to contact me remove the -nospam