Solved

Create a Paradox Table with BC5 and BDE32

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now