Solved

Create a Paradox Table with BC5 and BDE32

Posted on 1997-08-17
3
371 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

830 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