Error with compiling component to use in ASP

Results 1 to 2 of 2

Thread: Error with compiling component to use in ASP

  1. #1
    Charles Guest

    Default Error with compiling component to use in ASP

    Hello, I&#039;m getting an error at the second line of my function, the component was installed in an MTS Package any idea what I&#039;m doing wrong? I can&#039;t seem to recompile it from VB after inserting the MTS commands.<BR><BR>Thanks,<BR><BR>Error message: User-define type not defined <BR> <BR> Public Function GetOrderTest(AccountNumber) As Collection<BR> Dim objOContext As ObjectContext<BR> Set objOContext = GetObjectContext()<BR> Dim lErrNo As Long<BR> Dim sErrDesc As String<BR> On Error GoTo ErrorHandler<BR> Dim GetOrders As New Collection<BR> Dim objConn As New ADODB.connection<BR> Dim objRS As New ADODB.recordset<BR> Dim objCommand As New ADODB.Command<BR> Dim objParam As New ADODB.Parameter<BR> With objConn<BR> .ConnectionString = DB_CONNECTIONSTRING<BR> .Open<BR> End With<BR> &#039;Use command object to send accountnumber to stored procedure<BR> &#039;******************************************** ****************<BR> Set objCommand = New ADODB.Command<BR> With objCommand<BR> .CommandText = "GetTest"<BR> .CommandType = adCmdStoredProc<BR> .ActiveConnection = objConn<BR> End With<BR> Set objParam = objCommand.CreateParameter("@AccountNumber", adVarChar, adParamInput, 9, AccountNumber)<BR> objCommand.Parameters.Append objParam<BR> Set objRS = objCommand.Execute<BR> &#039;******************************************** **************************<BR> &#039;recordset.Open "GetTest", connection, adOpenForwardOnly, adLockReadOnly, adCmdText<BR><BR> Do While Not objRS.EOF<BR> Dim SNOrder As New SNCls3.SNOrder3<BR> SNOrder.Symbol = Trim$(recordset("Symbol"))<BR> SNOrder.OrderType = Trim$(recordset("OrderType"))<BR> SNOrder.CompanyName = Trim$(recordset("CompanyName"))<BR> SNOrder.TransactionType = Trim$(recordset("TransactionType"))<BR> SNOrder.Quantity = Trim$(recordset("Quantity"))<BR> SNOrder.RecordId = Trim$(recordset("RecordID"))<BR> SNOrder.OrderStatus = Trim$(recordset("OrderStatus"))<BR> SNOrder.CurrentDate = Trim$(recordset("CurrentDate"))<BR> SNOrder.TradeDate = Trim$(recordset("TradeDate"))<BR> SNOrder.SettlementDate = Trim$(recordset("SettlementDate"))<BR> SNOrder.AccountType = Trim$(recordset("AccountType"))<BR> SNOrder.Price = Trim$(recordset("Price"))<BR> SNOrder.Duration = Trim$(recordset("Duration"))<BR> SNOrder.CommissionType = Trim$(recordset("CommissionType"))<BR> SNOrder.Solicited = Trim$(recordset("Solicited"))<BR> SNOrder.Canceldate = Trim$(recordset("CancelDate"))<BR> SNOrder.SNCustomerAccNum = Trim$(recordset("SNCustomerAccNum"))<BR> SNOrder.SNOrderSeqNum = Trim$(recordset("SNOrderSeqNum"))<BR> SNOrder.PershingRefNum = Trim$(recordset("PershingRefNum"))<BR> SNOrder.EnteredToPershing = Trim$(recordset("EnteredToPershing"))<BR> SNOrder.CancelOrder = Trim$(recordset("CancelOrder"))<BR> SNOrder.LastUpdate = Trim$(recordset("LastUpdate"))<BR> <BR> GetOrders.Add SNOrder<BR> Set SNOrder = Nothing<BR> objRS.MoveNext<BR> Loop<BR> &#039; Using MTS to complete transaction<BR> objOContext.SetComplete<BR> Set objRS = Nothing<BR> Set objConn = Nothing<BR> Set GetOrderTest = GetOrders<BR> Exit Function<BR> &#039;**********************************<BR> &#039; Using MTS to Abort transaction<BR>ErrorHandler:<BR> &#039; Store incoming values<BR> lErrNo = Err.Number<BR> sErrDesc = Err.Description<BR> &#039; Allow resume next after error<BR> Resume NextLine<BR>NextLine:<BR> &#039; Clean up<BR> On Error Resume Next<BR> &#039; Rollback Transaction<BR> Call objOContext.SetAbort<BR> &#039;Close Recordset and Connection<BR> Call objRS.Close<BR> Set objRS = Nothing<BR> Call objConn.Close<BR> Set objConn = Nothing<BR> On Error GoTo 0<BR> &#039; Raise error<BR> Call Err.Raise(lErrNo, OBJNAME, sErrDesc)<BR>End Function

  2. #2
    Join Date
    Dec 1969

    Default RE: Error with compiling component to use in ASP

    Don&#039;t you have to set a reference to a MTS library? I haven&#039;t done MTS in a while... In any case, that&#039;s usually the culprit when you get errors like that in VB. <BR>Good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts