The documentation says to open a FoxPro table contained in an Advantage data dictionary only the table name is needed for AdsOpentable() and the DD will resolve the physical path but it fails for me unless I also provide the path. For example:

Fails: AdsOpenTable(conn1.ConnectionHandle, 'Shipment', 'Shipment', ADS_CDX, _
ADS_ANSI, ADS_COMPATIBLE_LOCKING, ADS_IGNORERIGHTS, ADS_DEFAULT, hTable)

Works: AdsOpenTable(conn1.ConnectionHandle, '\server\foxpro\Shipment', 'Shipment', ADS_CDX, _
ADS_ANSI, ADS_COMPATIBLE_LOCKING, ADS_IGNORERIGHTS, ADS_DEFAULT, hTable)

Is this a known issue? My concern is something is wrong with the DD or system configuration as the docs says it should work without the path but it does not.

The error returned is "5041 The requested object was not found."

Thanks, Carl

asked 18 Sep '12, 12:10

CarlP's gravatar image

CarlP
1196613
accept rate: 0%

edited 26 Feb '15, 09:22

Jens%20M%C3%BChlenhoff's gravatar image

Jens Mühlenhoff
1.3k51037


I suspect that the problem is that the table type is given. If a table type (e.g., ADS_CDX) is provided, then the table is attempted to be opened as a free table (thus the full path is needed). To open it as a database table, specify ADS_DEFAULT as the table type. I believe the following should work:

 AdsOpenTable(conn1.ConnectionHandle, 'Shipment', 'Shipment', ADS_DEFAULT, _
        ADS_DEFAULT, ADS_COMPATIBLE_LOCKING, ADS_IGNORERIGHTS, ADS_DEFAULT, hTable)
link

answered 18 Sep '12, 12:56

Mark%20Wilkins's gravatar image

Mark Wilkins
7.2k226133
accept rate: 26%

Mark,

Thank you!! that change fixed the problem for me. I would not have thought of that as being a problem and did not find any reference to it in the docs.

(19 Sep '12, 05:38) CarlP
Your answer to the original question.
If responding to a request for additional information, please edit the question or use the comment functionality.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×154
×76
×24
×4

Asked: 18 Sep '12, 12:10

Seen: 2,212 times

Last updated: 26 Feb '15, 09:22

Advantage Developer Zone Contact Us Privacy Policy Copyright Info


Powered by Advantage Database Server and OSQA
Disclaimer: Opinions expressed here are those of the poster and do not necessarily reflect the views of the company.