Problem with ADO and COM+ while trying to migrate ASP application on Windows Server 2003 from Win2k

Posted on 2006-05-21
Last Modified: 2013-11-25
I have been trying to deploy my web apps on Windows server 2003 that are running on windows server 2000 currently.  I deployed the COM dlls in COM+ on the new server by creating an empty package and configuring localservice account as identity.  When I tried to run my applications i detected an error that never occured on Win2k.  
I am returning a reference to a connection object from the dll to the asp page.  On the asp page, when I try to set activeconnection property of a command object, I get error 3001 "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another"

The code in my dll("ALJLibrary.DataInsert") is as follows
Public Function ConnectDB(ByVal appName) As ADODB.Connection
On Error GoTo ErrHand
    Set oCn = New ADODB.Connection
    oCn.ConnectionString = getConstr(appName)'gets connection string from the registry for the corresponding Application
    Set ConnectDB = oCn
    Exit Function
    Err.Raise Err.Number, Err.Source, Err.Description
    Set ConnectDB = Nothing
End Function

The code in my asp client is as follows
Dim oCmd
Dim oCn
Dim oDataUtil
Sub MakeConnection
    Set oDataUtil = Server.CreateObject("ALJLibrary.DataInsert")
    Set oCn = oDataUtil.ConnectDB("SalesForecast")
    Set oCmd = CreateObject("Adodb.command")
    Set oCmd.activeConnection = oCn (This line generates the error 3001 "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another")
End Sub

I tried recompiling the dll on a Windows 2003 server to rule out any dependancy issues because I detected that there was a change in version of COMSVCS.dll and also I reset reference to ADO 2.8.  
I am not using role based authentication nor am I trying to invoke the components across machine boundary.  
Also, I have observed that when I set the COM+ application as a library package then the same code works without any issues.  
This indicates that something goes wrong when my asp page tries to get a reference to connection object for the activeconnection property of the command object across process boundary.  
Although, I am able to get a reference to the connection object and even use the connection object to execute queries i.e. oCn.execute (I tried that in simulated environment), the problem occurs only when I try to set activeconnection property of the command object.  I have been trying to resolve this issue since the past week and so far I have been unable to find any documentation reporting this error.
Please help
Question by:iloya
    LVL 30

    Expert Comment

    First...can you confirm the obvious?
    Is ASP "allowed" under web extensions?  If so, does it have the same permissions/security as you had in 2k?

    NEXT..some info for you to review....

    Here is a Raisor solution from PAQ:
    You'll get a lot of information at:

    ... and a good tutorial how to set up Active Directory on Windows 2003 Server can be found at:

    ... you might also want to read about "ADAM", which is a part of Microsoft’s fully integrated directory services available with Windows Server 2003, and which is built specifically to address directory-enabled application scenarios:

    ... and a tutorial for "ADAM":

    ... and another tutorial with sample scripts to Scripting Exchange Using VBScript and ADSI at:
    LVL 2

    Author Comment

    Thanx.  I have actually confirmed that asp is an allowed extension and also that security configuration is same as that of existing deployment on Win2k.  Infact asp pages are running well except for the fact that I get an error when the code set oCmd.ActiveConnection = oCn is executed.  
    Thank you for the links but I guess my problem is not Active Directory since the server I am working on is a member server and I have administrative access to this server.  The code doesnt work even if I set package identity to interactive with me as active user.  
    LVL 30

    Expert Comment

    what happens if you use the IIS user guest account?
    LVL 19

    Expert Comment

    by:Melih SARICA
    ur problem is about the activeconnection Property ..

    read this link carefuly for Active connection property ..
    Sets or gets what kinda data ...
    LVL 2

    Author Comment

    I have been able to reoslve the problem on my own and I found out that none of the answers posted are relevant.  I discovered that there is a version change of COMSVCS.dll, the main COM+ runtime and so I tried to recompile my dlls on a windows 2003 server.  However this also failed so I had to do with a workaround by creating standalone connections in my pages rather than getting a reference to the connection object being returned from my COM components.  I guess that the gradual transition of ADO to ADO.Net has much to contribute in this and soon this problem would be highlighted

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Title # Comments Views Activity
    fix34  challenge 9 70
    c# combobox autocomplete behavior 6 62
    add text to end of existing text in file 16 54
    parentbit challenge 3 37
    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    A short article about problems I had with the new location API and permissions in Marshmallow
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now