problem creating com+ object using ASP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MG

    #1

    problem creating com+ object using ASP

    Hello all,
    Perhaps you can help me. I have a com object which I converted from VB6
    to VB.NET. I am using this com object with other .Net applications
    without any problem. However, I am now trying to use this com object in
    some old ASP code which I have not yet converted. I want to use the com
    object because it contains some additional functionallity that the
    original com object did not possess. The ASP code works fine when
    calling the old com object. BUT..if I change the code to call the new
    com object, it takes a very very (60secs.) long time for the object to
    be instantuated. In other words, when the code hits the CreateObject
    line, it takes 60 secs to execute. The rest of the calls to the methods
    of that com object execute normally. What am I doing wrong? I am
    including code snipplets of both the VB.NET com object and the ASP
    page.

    Thank you in advance.

    Michael Gisonda

    VB.NET---------------------
    Option Strict Off
    Option Explicit On
    Imports System.Enterpri seServices
    Imports System.Reflecti on
    Imports System.Runtime. InteropServices

    <Assembly: AssemblyVersion ("3.0.0.0")>
    <Assembly: ComCompatibleVe rsionAttribute( 1, 0, 0, 0)>
    <Assembly: ApplicationName ("EstSyspro_NET ")>
    <Assembly:
    AssemblyKeyFile Attribute("N:\P rojects\Estimpa ct.net\bin\EstS yspro.snk")>


    <System.Runtime .InteropService s.ProgId("EstSy spro_NET.Custin fo")>
    Public Class Custinfo
    Inherits ServicedCompone nt
    Private gImpConn As ADODB.Connectio n
    Private mConnection As Object

    <AutoComplete() Public Function GetBlanketContr actInfo(ByVal contract
    As String, ByVal stockcode As String, Optional ByVal companyid As
    String = "L") As ADODB.Recordset

    Dim sSQL As String
    Dim rsRetRecord As New ADODB.Recordset
    Dim rsGetRec As New ADODB.Recordset
    Dim lLocalConnectio n As New ADODB.Connectio n

    'Take the company id provided by the user and make it
    capitalized and only the first letter.
    companyid = UCase(Trim(Mid( companyid, 1, 1)))

    'Set the connection string to the proper company based on the
    companyid
    lLocalConnectio n.ConnectionStr ing =
    fnGetConnection String(companyi d)

    'Open the connection.
    lLocalConnectio n.Open()

    sSQL = "SELECT SorContractPric e.ContractType,
    SorContractPric e.StockCode, " & "SorContractPri ce.Contract,
    SorContractPric e.StartDate, " & "SorContractPri ce.ExpiryDate,
    SorContractPric e.PriceMethod," & "SorContractPri ce.FixedUom,
    SorContractPric e.FixedPriceCod e, " & "SorContractPri ce.FixedPrice " &
    "FROM SorContractPric e " & "WHERE SorContractPric e.Contract= '" &
    contract & "' " & "AND SorContractPric e.StockCode= '" & stockcode & "'"

    rsGetRec = lLocalConnectio n.Execute(sSQL)

    If Not rsGetRec.BOF And Not rsGetRec.EOF Then
    rsRetRecord = MakeRS(rsGetRec )
    OpenAndFillRS(r sGetRec, rsRetRecord)
    Else
    rsRetRecord = Nothing
    End If

    'Clean up
    rsGetRec.Close( )
    rsGetRec = Nothing
    lLocalConnectio n.Close()
    lLocalConnectio n = Nothing

    GetBlanketContr actInfo = rsRetRecord

    End Function
    End Class

    END VB.NET -----------------------------------------

Working...