Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DBLink Error

Posted on 2002-06-02
5
Medium Priority
?
527 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Suggested Courses

715 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