Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Oracle8i and Microsoft Transaction Server
Hi,
I am making my first steps with a DLL installed into a new MTS package =
on the LAN NT/4.0(SP5) server with a [tested] DSN connection string to =
Oracle8i on that same server machine. All the necessary services are up =
and running: MSDTC, OracleMTSService0. And on my client machine =
(NT/4.0(SP5) I am calling this remote component out of a small VB6 test =
project with ADO code (and yes, the reference goes to the registered =
remote component, having done an export on the server machine out of the =
MTS explorer to the appropriate client directory and having double =
clicked the generated client registration Exe):
Option Explicit
Private Sub Command1_Click()
Dim objRecordset As EpiMobMTS1.clsGetRecordset
Dim rs As ADODB.Recordset
On Error GoTo EH
Set objRecordset = CreateObject("EpiMobMTS1.clsGetRecordset") Set rs = objRecordset.GetRecordset(Me.Text1.Text)
Set Me.Adodc1.Recordset = rs
Exit Sub
'-----------------------
The Code of the DLL on the Server is the following:
Option Explicit
Implements ObjectControl
Private mobjContext As ObjectContext
Private rs As ADODB.Recordset Private cn As ADODB.Connection Private cm As ADODB.Command
epimts_GetByIDError = vbObjectError + 1 epimts_GetBySqlError epimts_DeleteError epimts_InsertError epimts_UpdateError
Public Function GetRecordset(ByVal qry As String) As ADODB.Recordset
On Error GoTo eh
Set cn = New ADODB.Connection
With cn
.ConnectionString = ORA_CONNECT
.Open
End With
Set rs = New ADODB.Recordset
With rs
.ActiveConnection = cn
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockReadOnly
.Source = qry
.Open
End With
Set GetRecordset = rs
mobjContext.SetComplete
Exit Function
eh:
mobjContext.SetAbort
With Err
Err.Raise epimts_GetBySqlError, "clsGetRecordset", "Could not get =
Recordset by Sql"
End With
End Function
Private Sub ObjectControl_Activate()
Set mobjContext = GetObjectContext
End Sub
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = True
End Function
Private Sub ObjectControl_Deactivate()
Set cn = Nothing
Set mobjContext = Nothing
End Sub
Calling the remote MTS component always ends in "Could not get Recordset = by Sql". And the "Transaction Statistics" on the Server show each time = that one more transaction was aborted. The Application Event Log does = not show any errors.
Could somebody give me a good advice?
Thanks and kind regards
Paul
Received on Sat Oct 09 1999 - 12:41:40 CDT
![]() |
![]() |