Solved

DBLink Error

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 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

20 Experts available now in Live!

Get 1:1 Help Now