Results 1 to 4 of 4

Thread: Connection error in COM+(Oracle;MSDAORA)

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Location
    Geleen(NL)
    Posts
    3

    Exclamation Connection error in COM+(Oracle;MSDAORA)

    Hi,

    I've developed a webservice(ASP with COM+(VB6.0)) that has to support both SQL Server as Oracle. I've tested all functionality succesfull with SQL Server(TSQL). However when I try to connect with Oracle I get the following error(in Dutch):
    Code:
    Error -2147168229 : 19-09-2005 15:00:18 
    - Description: GetConnection error: 'ORA; Provider=msdaora;Data Source=demo;User Id=demonl93;Password=demonl93; Kan geen verbinding maken met transactiebeheer, of transactiebeheer 
    is niet beschikbaar.'
      - Line Number: 46
    The error in English: "Can't connect to transactionmanagement, or ..."

    The lines above are from a self-written log-function. Underneath the vbcode that retrieves the connectionstring from a user defined registrysetting.

    VB Code:
    1. Public Sub GetConnection(ByRef cnCon As ADODB.Connection)
    2.  
    3.     On Error GoTo GetConnection_ERR
    4.    
    5.     'get database type and connection string from the registry.
    6. 10  strConnType = GetRegistrySetting("DBTYPE")
    7. 20  strConString = GetRegistrySetting("constring")
    8.     'ensure objCon holds a reference to a connection object
    9.     If cnCon Is Nothing Then
    10. 30      Set cnCon = New ADODB.Connection
    11.     End If
    12.     With cnCon
    13. 40      .ConnectionString = strConString
    14. 42      .ConnectionTimeout = 10
    15. 44      .CursorLocation = adUseClient
    16. 46      .Open
    17.     End With
    18.          
    19.     Exit Sub
    20. GetConnection_ERR:
    21.     'log the error
    22.     logError Err.Number, "GetConnection error: '" & strConnType & "; " & strConString & "; " & Err.Description & "'", Erl()
    23. End Sub

    VB Code:
    1. Public Function GetRegistrySetting(ByVal strKeyValue As String) As String
    2.  
    3. On Error GoTo GetRegistrySetting_ERR
    4.  
    5. Dim lngKeyRoot As Long
    6. Dim strKeyName As String
    7. Dim lngRetVal As Long      '// result of the API functions
    8. Dim lngKey As Long         '// handle of opened key
    9. Dim vntValue As Variant    '// setting of queried value
    10.  
    11. 10  lngKeyRoot = HKEY_LOCAL_MACHINE
    12. 20  strKeyName = FMWEBSERVICE_REGISTRY_KEYNAME
    13. 30  lngRetVal = RegOpenKeyEx(lngKeyRoot, strKeyName, 0, KEY_READ, lngKey)
    14. 40  lngRetVal = QueryValueEx(lngKey, strKeyValue, vntValue)
    15. 50  RegCloseKey (lngKey)
    16.    
    17. 60  GetRegistrySetting = vntValue
    18.     Exit Function
    19.    
    20. GetRegistrySetting_ERR:
    21.     'log the error
    22.     logError Err.Number, "GetRegistrySetting: '" & Err.Description & "'", Erl()
    23. End Function

    This is how the registry settings look like:
    Constring: Provider=msdaora;Data Source=demo;User Id=demonl93;Password=demonl93
    Dbtype: ORA

    Hopefully someone can help me?

    Tnx!

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Connection error in COM+(Oracle;MSDAORA)

    Do you have the proper entry in your TNSNames.ora file?

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Location
    Geleen(NL)
    Posts
    3

    Re: Connection error in COM+(Oracle;MSDAORA)

    The tnsnames.ora file has to be correct, because I can connect with SQL+ to the database listed in the registry. I Have also a CMS for this webservice which doesn't use COM+(VB-code listed in this thread) and that just works perfectly.

    Is there perhaps a setting in the Component Services of Windows that maybe has to be modified or can I change a transaction setting within my VB-code?

    Grtz.

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Location
    Geleen(NL)
    Posts
    3

    Re: Connection error in COM+(Oracle;MSDAORA)

    I've adjusted some settings in Visual Basic(v6) that seem to resolve the problem.

    The error only occured on objects where I setted the property "MyTransactionMode" as "2 - RequiresTransaction". I found out that changing this setting to "3 - UsesTransaction" solved the error.

    Can anybody tell me what the exact consequence of this change is? Who knows if the problem in the first situation("2 - RequiresTransaction") can be solved?

    tnx!

Posting Permissions

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



Click Here to Expand Forum to Full Width