Hello. I'm developing a wrapper class around the Advantage ADS Client API within a legacy VFP 9 application - on a Windows 7 platform. I'm successfully connecting to VFP 9 tables as free tables in compatibility mode and VFP type tables.

I've been able to successfully declare and call many of the ADS functions, such as opening a table as shared, navigating up and down the tables and getting / setting values. However, there are many that I am getting various errors on, such as BOF, EOF, Seek, Locate, Found, etc. The most common error is "Too Many Arguments" or "Data Mismatch". Also, while I can successfully call OpenTable for shared, I get an error when I call it for exclusive - the error says it can't open the table, even though the table is not being used elsewhere.

I figure it's likely my Declares, but I have followed all the directions in the on-line help and not been able to figure out exactly why.

Can someone please direct me to any examples of the above as programmed specifically in VFP, or any additional info I need to be successful with these functions?

My Declares for the above are as follows:

DECLARE LONG AdsAtBOF IN ace32 INTEGER hTable, BOOLEAN @pbBOF
DECLARE LONG AdsAtEOF IN ace32 INTEGER hTable, BOOLEAN @pbEof 
DECLARE LONG AdsSeek IN ace32 INTEGER hIndex, STRING pucKey, SHORT usKeyLen, SHORT usDataType, 
SHORT usSeekType, BOOLEAN @pbFound
DECLARE LONG AdsLocate IN ace32 INTEGER hTable, STRING pucExpr, BOOLEAN bForward, BOOLEAN @pbFound
DECLARE LONG AdsIsFound IN ace32 INTEGER hTable, BOOLEAN @pbFound

asked 02 Jun '14, 08:30

gverge393's gravatar image

gverge393
126111118
accept rate: 100%

edited 02 Jun '14, 08:35

Alex%20Wong's gravatar image

Alex Wong
5.3k2488


I think BOOLEAN in VFP 9 may be just 1 byte. ACE expected a two byte variable in those places. Try changing all occurrence of BOOLEAN to SHORT in the declaration.

link

answered 02 Jun '14, 08:42

Alex%20Wong's gravatar image

Alex Wong
5.3k2488
accept rate: 42%

Thanks Alex. You hit it right on the mark! They all work now. I am still having issues with some other functions - which don't take Booleans in the Declare - but I will ask about those in a different post.

(02 Jun '14, 15:14) gverge393

Alex was absolutely correct on this one. Always use a VFP Short instead of a VFP Boolean to declare an ACE function that indicates a Boolean as an argument.

(02 Jun '14, 15:18) gverge393
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:

×172
×24

Asked: 02 Jun '14, 08:30

Seen: 1,216 times

Last updated: 23 Jul '14, 08:26

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.