Solved

DBLink Error

Posted on 2002-06-02
5
505 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help in WHSCRIPT 9 47
ms access #TYPE! error on report when no data 4 67
Reading the Contents of a Directory In Access VBA 5 58
Best way to parse out a json string in VB6? 10 115
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now