Hi Chris.
>I'm looking for some documentation on the structure of the properties field in a DBC file.
Each property in the PROPERTY memo is formatted as follows:
L1 L2 L3 L4 N1 N2 B1 ... Bn VALUE
L1 to L4 represent the length of the entire property. This length is stored as a 4-byte binary number, with the least significant byte in L1. For example, a length of 15 would be stored as 15 0 0 0 (note: this doesn’t mean the digits "1 5 0 0 0", but chr(15) chr(0) chr(0) chr(0)). A length of 260 would be stored as 255 5 0 0.
N1 and N2 represent the length of the ID code for the property. This length is stored as a 2-byte binary number, with the least significant byte in N1. Since all current properties have an ID less than 255, these bytes normally contain 1 0.
B1 to Bn is the ID code for the property stored as a binary number as long as defined in N1 and N2. Since all current properties have an ID less than 255, only 1 byte is normally used.
VALUE is the actual value of the property. Strings are terminated with chr(0).
The PrimaryKey property of a table has an ID of 20 (decimal). To remove this property, you'll need to find the entire "record" for the property in the PROPERTY memo and remove it (easiest using STUFF()).
Hope this helps.
BTW, I see in our database that your company has SDT (albeit an older copy, 5.0). It has a DBCDeleteProp method that will handle this for you. Simply open the DBC as a table, position to the desired table record, and call DBCDeleteProp, passing 20 as the ID for the property to remove.
Doug