Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error '430', Runtime error '3001'

Status
Not open for further replies.

hawran

Programmer
Dec 17, 2002
4
CZ
Hi,
I have these problems:

1: I have an ActiveX DLL component (VB6+SP5, ADO 2.7) developed for executing of stored procedures in a DB(MS-SQL2000). That component is installed within COM+ (W2K+SP2). When I used default option for "Transaction support" (option 'Supports'), it worked normally. As I wanted to simplify my stored procedures, I used option 'Required' to force MTS to execute the stored procedure within a transaction and I was surprised unpleasantly.
Briefly: the component creates ADODB.Connection (by
Code:
GetObjectContext.CreateInstance(...)
), sets required parameters and opens it. Then... . But in this case (required transaction) calling of an Open() method causes error: Run-time error '430': Class does not support automation or does not support expected interface.
So I tried to call Open() method as was documented:
Code:
lobj_connection.Open CStr(lstr_Connectionstring), CStr("admin"), CStr(""), CLng(adUseClient)
and ... Runtime error '3001': The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
Does anybody know what does it mean??? And what's wrong?

2: I have a class for providing maintenance of connection objects. This class is 'Private' in a project. Should I create an instance of that class in a component by
Code:
GetContextObject.CreateInstance()[code]? I tried it and I got [b]Run-time error '429': ActiveX component can't create object[/b].

Thank you,
hawran
 
Private Classes can only be created using CoCreateObject (new in VB). You cannot create it using GetObjectContext.CreateInstance(). Private classes cannot be created within in the COM+ context.

Also, you should not create ado connection objects with GetObjectContext.CreateInstance(). Use the New keyword.

In COM+, you should use CreateObject() instead of GetObjectContext.CreateInstance(). GetObjectContext.CreateInstance() is for MTS and is in COM+ only for backwards compatibility.

The basic rule I go by is to use New for all dll's not hosted in COM+ and use CreateObject() for COM+ dll's.

Hope this helps.

Chris.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top