I have a VFP9 free table with the following field definitions: UnitID AS Integer DateTime AS DateTime (Timestamp) Also defined on the table is an ADS non-unique index created using the Advantage Data Architect, defined as UNITDATE with the expression UNITID;DATETIME

Using the ADS Client API. I've attempted to do a Seek on this within code, as well as using the Search field in the Architect, to no avail. I've entered several combinations of unit id 19 and datetime of "07/04/2014 1:40:00 PM" - with and without single quotes and semicolon, etc. - still no joy. I've even used the exact format displayed in the Architect.

The VFP code snippet follows:

SET HOURS TO 12
KeyVal = ALLTRIM(STR(nUnitID)) + ";'" + TTOC(ndatetime) + "'"
WAIT WINDOW KeyVal && displays "19;'07/01/2014 1:40:00 PM'"
result = AdsSeek(Handle, KeyVal, LEN(KeyVal), 2, 1, @locValue)
IF result == 0
  IF locValue == 0
    WAIT WINDOW "Seek NOT Successful"
  ELSE
    WAIT WINDOW "Seek Successful"
  ENDIF
ELSE
  WAIT WINDOW "ADS Error on Seek call"
ENDIF
Thanks.

asked 02 Jul '14, 07:05

gverge393's gravatar image

gverge393
126111118
accept rate: 100%

edited 02 Jul '14, 07:38

Joachim%20Duerr's gravatar image

Joachim Duerr
8.7k1031133


Check out AdsInitRawKey and AdsBuildRawKey for creating the correct key values based on your index and settings.

link

answered 02 Jul '14, 07:41

Joachim%20Duerr's gravatar image

Joachim Duerr
8.7k1031133
accept rate: 18%

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
×39
×24

Asked: 02 Jul '14, 07:05

Seen: 1,552 times

Last updated: 02 Jul '14, 07:41

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.