Solved

DBLink Error

Posted on 2002-06-02
5
510 Views
Last Modified: 2012-08-13
Hi,

Iam having Public synonym for DBLINK remote database ,
When i execute a query iam getting the following error...
[Oracle][ODBC][Ora]ORA-02041: client database did not begin a transaction.
I use ADO - 2.1 , Oracle 8.1.7 , Vb 6.0


Code
  Set cm.ActiveConnection = GetConnection
    cm.CommandText = "SELECT RTRIM(agt_cd) agt_cd  FROM pragent ORDER BY agt_name"
    Set GetAllAgentCodes = cm.Execute

(PRAGENT table is synonym for remote database table)

Can you help to solve ??????
Thanks...
0
Comment
Question by:ashok73
5 Comments
 
LVL 2

Expert Comment

by:woka
ID: 7050329
Not quite sure what you want to have returned, but try one of the following:

SELECT RTRIM(agt_cd) AS agt_cd  FROM pragent ORDER BY agt_name

OR

SELECT RTRIM(agt_cd), agt_cd  FROM pragent ORDER BY agt_name
0
 
LVL 5

Expert Comment

by:bob_online
ID: 7051665
Login to your database and see if the select statement runs.  Is your get connection code actually working?

try:

cm.CommandText = "SELECT RTRIM(agt_cd) agt_cd  FROM pragent@DBLINK_NAME ORDER BY agt_name"

replacing DBLINK_NAME with the name of the database link, which I think must also have a public synonym.  

0
 
LVL 5

Expert Comment

by:rpai
ID: 7054875
Consider the following select statement using a dblink: select * from scott.emp@orcl;
Using the Oracle OLE DB Provider returns ORA-02041 In SQL Plus the error is not encountered.

In connection string attributes must set DistribTx=0 which disables distributed transactions. This can also be set in the registry. Default registry setting is 1 or enabled. Can be found in the registry under HKEY_LOCAL_MACHINE\Software\Oracle\Oledb. Note: If DistribTx is not in the registry then Oracle Provider for Ole DB 8.1.6.1.0 or higher was not installed.

0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7851387
Hi ashok73,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.

ashok73, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7912984
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSRS expression Issue finding a string 10 79
Macro: print each sheet to pdf using ExportAsFixedFormat 11 48
Excel - Save a copy of work book 13 84
How to Add / Edit Windows Menu 4 60
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

772 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