Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DBLink Error

Posted on 2002-06-02
5
Medium Priority
?
535 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

885 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