Table/View/Synonym not found - Can't query openedge db via ODBC

Posted on 2009-04-27
Last Modified: 2013-12-25

I'm trying to write a console application in that will query an openedge 10.1b database and return the results (yeah, I could use the Progress tools but I wanna do other stuff with the data independent of the openedge server - this is just a proof of concept)

The connection seems to open ok - but having problems running a query.

I've attached my code - which fails at line 10.

The error returned is:

ERROR[42502][DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Table/View/Synonym not found

Presumably there is something wrong with my query? The table removals definitely exists, and definitely contains the fields r-num and r-name - which are both

Any clues?

Imports System.Data.Odbc

Module Module1

    Sub Main()

        Dim DbConnection As New OdbcConnection("DSN=removedforsecurity;Uid=sysprogress;Pwd=")


        Dim DBcmd As New OdbcCommand

        DBcmd = DbConnection.CreateCommand

        DBcmd.CommandText = "SELECT r-num, r-name FROM removals"

        Dim DBReader As OdbcDataReader

        DBReader = DBcmd.ExecuteReader()

        Dim strcol1 As String

        Dim strcol2 As String

        While DBReader.Read

            strcol1 = DBReader.GetString(DBReader.GetOrdinal("r-num"))

            strcol2 = DBReader.GetString(DBReader.GetOrdinal("r-name"))

            Console.WriteLine(strcol1, " - ", strcol2)

        End While




    End Sub

End Module

Open in new window

Question by:MDWinter
    LVL 10

    Accepted Solution


    DBcmd.CommandText = "SELECT r-num, r-name FROM pub.removals"

    Author Comment

    Knight00 - I actually tried that before you replied and it partially works so I'll give you the points and start a new topic.

    As a note for anyone that might come across this in future - to help get the sql query bit right I downloaded ODBCView as you can use it to pass the query to the ODBC driver and see what the result is.

    There's also a problem with the hyphen in the field name but I'll put that in a separate post.

    Author Comment

    I also figured out the rest myself - the field names need to be enclosed in double quotes :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 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

    7 Experts available now in Live!

    Get 1:1 Help Now