×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Unique index problem

Unique index problem

Unique index problem

(OP)
I have a weird problem in dBase III+

DB structure:
Field  Field Name  Type       Width    Dec
    1  JNUMMER     Numeric        6
    2  BRIN        Character      4
    3  PLDATUM     Date           8
    4  LEERJAAR    Numeric        1
    5  TICK        Logical        1

(set date british
set century on
set deleted on)

. list all for jnummer=23
Record#  JNUMMER BRIN PLDATUM    LEERJAAR TICK
    738       23 20TQ 1986.12.08        8 .T.
  14213       23 17YS 1995.08.01        2 .T.
  19066       23 17YS 1998.08.01        0 .F.

. INDE ON STR(JNUMMER)+BRIN+DTOC(PLDATUM) TO BRINHIS UNIQUE
(or SET UNIQUE ON and then INDEX without the UNIQUE)

. list all for jnummer=23
Record#  JNUMMER BRIN PLDATUM    LEERJAAR TICK
  14213       23 17YS 1995.08.01        2 .T.
    738       23 20TQ 1986.12.08        8 .T.

This is wrong, the index includes the date, so all three records are unique. The 19066 record should be there.

Other symptoms:
I cannot BROWSE, I constantly get 'Record is not in index', whether I GO BOTTOM or GO TOP or SKIP first

What can be going on here?

Thanks in advance
Jan

 

RE: Unique index problem

(OP)
Problem resolved!

The error was in the STR(JNUMMER) in the index key - this makes variable length index keys and xBase can't handle that
(I even tried to do the above in Clipper code and got the same errors).
Changing it to STR(JNUMMER,10) solved the problem.

Somewhere deep in my memory I already knew this issue - it's been too long since I last used Clipper/dBase winky smile
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close