Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004

    Unanswered: Get Equal with Segmented Key

    Please help.

    I'm using Btrieve API in VB and I'm trying to use the get operation
    (GET EQUAL) to set the position of the record that I wan't to get.

    I always received status 4 or status 9 when I issue the Get Equal
    command. My key is segmented first is string len 15 and the 2nd is
    an integer.

    this is how I assign it to KeyBuffer:

    KeyBuffer = String15 & Trim(Str(IntKey))

    then GET Equal

    Hope to hear from you guys.


  2. #2
    Join Date
    Dec 2001
    Provided Answers: 4
    How is your KeyBuffer declared? It probably should be a User Defined Type like:
    type KBIndex
    strField as string * 15
    intField as integer
    end type
    Integers aren't stored as strings (or ASCII characters) in a Btrieve file, they are stored as byte swapped Intel integers.
    You can also turn on the MKDE tracing to see exactly what's being sent on the Get Equal.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Aug 2004


    It was defined like this:
    Key number was set to 0

    type sKey0
    Batchno as String*15
    Seq(0 to 1) as Byte
    end type

    and inside my code

    Dim sKeyBuf as sKey0
    Dim iSeq as Integer

    iSeq = 2

    sKeyBuf.Batchno = "000000000001008"

    CopyMemory sKeyBuf.Seq, iSeq, 2

    Status = BTRCALL(BGETEQUAL, pOldFilePos, lRecBuffer(1), BufLen, ByVal sKeyBuf, KeyBufLen, KeyNum)

    and most of the Status returned was equal to 4. I have 19 records and if
    I browse it to SQL Data Manager Batchno="000000000001008" and Seq=2 exist.

    Any other suggestion?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts