Solved

Create a Paradox Table with BC5 and BDE32

Posted on 1997-08-17
3
374 Views
Last Modified: 2013-12-26
hello,
I'd like to create a Paradox table from my application, with 20 fields and an index on the first field named "NOCRIH"
(I use BC++ 5.0 and BDE32 3.0)
When I create the table with a Paradox application I can read the table from my application.
But I can't create this table from my application.
I always got the "invalid index type" message !
I can't find where is the bug in my code
could you help me

here is a part of my code :


  DBIResult                 codeRetour;
  FLDDesc*                  ficheAgent;
  IDXDesc*                  hNoAgent;
  hDBIDb                    hBase;
  .../...


  ficheAgent = new FLDDesc[20];
  memset( ficheAgent, 0, 20 * sizeof(FLDDesc) );

  // Numéro identification CRIH
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ficheAgent[0].iFldNum = 1;                  // numéro du champ
  strcpy( ficheAgent[0].szName, "NOCRIH");    // nom du champ
  ficheAgent[0].iFldType = fldZSTRING;        // type de champ
  ficheAgent[0].iUnits1 = 6;                  // nombre caracteres

  // Nom
  //~~~~~
  ficheAgent[1].iFldNum = 2;
  strcpy( ficheAgent[1].szName, "NOM");
  ficheAgent[1].iFldType = fldZSTRING;
  ficheAgent[1].iUnits1 = NOMLEN + 1;

  .../...


  hNoAgent = new IDXDesc;
  memset( hNoAgent, 0,  sizeof( IDXDesc ) );

  hNoAgent->iIndexId = 1;
  strcpy(hNoAgent->szName, "NOCRIH");
  hNoAgent->bPrimary = TRUE;
  hNoAgent->bUnique =  TRUE;
  hNoAgent->bDescending = FALSE;
  hNoAgent->bMaintained = TRUE;
  hNoAgent->iFldsInKey = 1;
  hNoAgent->aiKeyFld[0] = 1;
  hNoAgent->bCaseInsensitive = TRUE;


  CRTblDesc tableAgent;
  memset( &tableAgent, 0, sizeof tableAgent );

  strcpy( tableAgent.szTblName, (char*)nomFichierAgent );
  strcpy( tableAgent.szTblType, szPARADOX );
  tableAgent.iFldCount = 20;
  tableAgent.pfldDesc = ficheAgent;
  tableAgent.iIdxCount = 1;
  tableAgent.pidxDesc = hNoAgent;

  codeRetour = DbiCreateTable( hBase,  FALSE, &tableAgent );



0
Comment
Question by:dreynier
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:dreynier
ID: 1299356
Adjusted points to 200
0
 
LVL 3

Accepted Solution

by:
msmits earned 200 total points
ID: 1299357
After some experimentation, it seems that the Paradox drivers don't support an CaseInsensitive primary index. If you read the help very carefully, you may notice that they only mention this possibility for secondary indices on Paradox tables. But you probably only notice that when you already know the problem.
So the solution should be:

  hNoAgent->bCaseInsensitive = FALSE;

When experimenting, I also noticed that when you use the function DbiAddIndex() to add the index, it returns with the same error code as the DbiCreateTable, but the last error information you can get with the DbiGetErrorInfo() function is not valid, so there is no exptended information about the error.

0
 

Author Comment

by:dreynier
ID: 1299358
Thanks for your help
I can now create a Paradox table  !

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Standards for file storage. 3 39
CSS: Element name is not scoping properly 4 80
Specific format 21 240
Stupid git question 2 136
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question