Re: ADO in multithreaded: Application Verifier (with WinDbg) gives "Invalid Handle" at the end of my application




Daniel Crichton wrote:

Sorry if this sounds like a stupid suggestion, but did you switch ADO to
free-threaded? By default ADO is apartment-threaded (both-threaded), so
calls will be serialized - this is so that it can support Access/Jet which
uses a single-threaded driver. You can change ADO to free-threaded by
editing the registry, you do this using the ADOFre15.reg file located in the
C:\Program Files\Common Files\System\ADO folder.

I'm using MSSql Server as database, so I don't think that changing in a
free-threaded will do something good. But, I'm somehow desperate and I
tried this too, with no luck of course.

If the database you are connecting to has a driver that support connection
pooling then trying to share a connection via threads may well result in
slower performance. It's also possible that the connection could be dropped
or the link to the server broken in some way, so you'll need to make sure
you handle this possibility too.

Dan
The connection to the database isn't shared, so I don't have to be
afraid from this part. Only a single thread uses it.

.



Relevant Pages

  • Re: Reading with ADO from Access database over network
    ... I suspect the *problem* isn't the failure to open the folder ... check the active Connection ... Perhaps you could follow the above instructions and post the *ADO* ... > exclusively the database. ...
    (microsoft.public.excel.programming)
  • Re: Reading with ADO from Access database over network
    ... Is your ADO code trying to open the Connection with exclusive locks ... If so, instead consider locking the ... workgroups security so the database is only locked when someone with ...
    (microsoft.public.excel.programming)
  • Re: Trapping ADO Connection Errors
    ... In the original example that I gave, when my VPN connection is dropped while ... so forth within my database code so users won't be stuck when something ... > Are you aware of the Error collection used by ADO: ... >> 1) I create ADO Connection object and successfully log into SQL Server. ...
    (microsoft.public.vb.general.discussion)
  • Re: Trapping ADO Connection Errors
    ... In the original example that I gave, when my VPN connection is dropped while ... so forth within my database code so users won't be stuck when something ... > Are you aware of the Error collection used by ADO: ... >> 1) I create ADO Connection object and successfully log into SQL Server. ...
    (microsoft.public.vb.database)
  • Re: Trapping ADO Connection Errors
    ... In the original example that I gave, when my VPN connection is dropped while ... so forth within my database code so users won't be stuck when something ... > Are you aware of the Error collection used by ADO: ... >> 1) I create ADO Connection object and successfully log into SQL Server. ...
    (microsoft.public.vb.database.ado)