
ADODB.Command Connection Error in MTS object
We had the same problem with ADO 2.1 Command Objects. We HAVE to pass the
Connection object as we're using Sybase 11 which does not have MTS automatic
transaction processing yet (D'Oh) and so we had to provide the transaction
processing ourselves. We got around it by using ADO.Recordset objects to
return recordsets and the Connection object itself to execute Insert/Update
SQL. If you rely on Connection pooling and recreate the the connection every
time you'll most likely commit you're transactions every time to, which is
useless. At least that's the case with Sybase.
We've been using Delphi for our development. Let me know if you want some
code.
Regards
Mike Skillicorn
Quote:
>Unfortunately, this is experience-based.
>I haven't even looked in the KB etc. for this topic.
>Seb
>> We actually have software that passes Connections that has been working
>> for over a year now. We use a broker DLL that holds the connection and
>> it gives access to the connection to 8 other COM DLLs that work with
>> various parts of the database. The hitch came when we upgraded to ADO
>> 2.1 -- and tried using Commands.
>> These other DLLs may not use ADODB.Command objects at all. Perhaps
>> you'll tell me that is why they have worked correctly. Is that the
>> case?
>> When you say not to pass the connection objects, are you saying that
>> based on experience, or documentation? Microsoft's knowledge base on
>> ADO is so small, it's hard to tell what they're promising and what
>> they're not. If you've got references to actual documentation, please
>> send them! I'm starved for real info.
>> Thanks for pitching in,
>> Andrew Wolfe
>> > Advice:
>> > Don't pass Connection objects between COM/ActiveX objects.
>> > It doesn't work.
>> > You will have to make a connection within every object that needs one.
>> > Seb
>> > > I'm also getting a 3001 myself, but I have nothing to do with MTS.
>> But
>> > > I am in a relatively complex setup with numerous COM DLLs (written
>> in
>> > > VB) where I'm opening a Connection in one DLL, and passing it along
>> to
>> > > another in which I'm assigning the connection to a
>> > > Command.ActiveConnection. That's where I get the 3001 error. I
>> hope
>> > > you're not telling me I have to use separate connections for every
>> > > command.
>> > > One twist is that there's a transaction open on the connection when
>> I
>> > > create the command object.
>> > > Any advice you can give me -- thanks in advance very very much!
>> > > Andrew Wolfe
>> > > > It is not recommended to pass ADO connection objects between MTS
>> > > components.
>> > > > The way to do it is passing the connectionstring and reconnect
>> every
>> > > time.
>> > > > Let the connection Pooling do the dirty work. The result is the
>> same,
>> > > but
>> > > > you don't have the problems.
>> > > > Filip
>> > > > > Sorry to cross-post, but I'm really stumped for ideas...
>> > > > > Anyone seen this:
>> > > > > Error# 3001
>> > > > > Source: ADODB.Command
>> > > > > Description: The application is using arguments that are of the
>> > > wrong
>> > > > type,
>> > > > > are out of acceptable range, or are in conflict with one
>> another.
>> > > > > It occurs in a MTS-hosted class when I try to associate a
>> (proven)
>> > > > > connection object to a command object using the
>> .ActiveConnection
>> > > > property.
>> > > > > I have tried the Connection object in question with
>> > > > > RECORDSET.ActiveConnection and it works perfectly.
>> > > > > Any ideas,
>> > > > > Is this MTS or ADO?
>> > > > > Thanks in advance,
>> > > > > Seb Reeve - Consultant - Sabio Limited
>> > > Sent via Deja.com http://www.deja.com/
>> > > Share what you know. Learn what you don't.
>> Sent via Deja.com http://www.deja.com/
>> Share what you know. Learn what you don't.