Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2006
    Posts
    11

    Unanswered: Error Creating New Table

    The following generates an error "The record has a key field containing a duplicate value(Btrieve error 5).
    CREATE TABLE Temp1 USING 'Temp1.DAT' (PBID IDENTITY, CustID Char(20))

    The following do not create an error

    CREATE TABLE Temp1 USING 'Temp1.DAT' (PBID INTEGER, CustID Char(20))
    or
    CREATE TABLE Temp1 USING 'Temp1.DAT' (PBID CHAR(3), CustID Char(20))

    I have tried changing the name to XXXXZZZ and I get the same error-no matter what table name I try to add.

    Any reason why is using the data type IDENTITY generating an error?

    This is an ongoing problem-every time the ERP software is upgraded I need to add my tables back into the DDFs. This time I can't.???:

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Do the data files exists? If so, you should add the "IN DICTIONARY" clause to the statement. Also, when the ERP system is updated do all of the DDFs get updated (FILE.DDF, FIELD.DDF, INDEX.DDF as a start)?
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Jun 2006
    Posts
    11
    The data files exist - disconnected from the ERP
    When they upgrade they send us all new DFFs

    Will the In Dictionary just add the table definition to the DDFs?
    Right now I create the empty table then replace it with the populated table

  4. #4
    Join Date
    Jun 2006
    Posts
    11
    I added the clause
    CREATE TABLE Temp1 IN DITIONARY USING 'Temp1.DAT' (PBID IDENTITY, CustID Char(20))

    I receive the same error message with the clause.

  5. #5
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Hmm. It sounds like you've got some problems with the DDFs. You might want to contact the ERP vendor to make sure you have the best DDFs and that there aren't any problems.

    Will the In Dictionary just add the table definition to the DDFs?
    Yes, the IN DICTIONARY clause only adds the table definition to the DDFs. It does not affect the existing data file.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  6. #6
    Join Date
    Jun 2006
    Posts
    11
    OK thanks.
    To be clear: If I use the In Dictionary, it connects the existing tables to the Pervasive DB? I won't have to swap the dat files around the way I have been?

    Thanks again for your help.

  7. #7
    Join Date
    Jun 2006
    Posts
    11
    I've been trying to isolate the problem. So far I know that if I reinstall the original File and Field DDFs I can add 1 new table with the first field as an Identity data type. When I try to add a second table with a different name and an Identity data type, I get the "btrieve error 5 - trying to add a duplicate record..." I can add an Integer or Char data type. I have tried adding the table using the Pervasive Control Center, VB, VBA - no luck. Any ideas on how to fix this? I have 8 tables with the first field an Identity data type.
    Thanks

Posting Permissions

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