Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Create a Paradox Table with BC5 and BDE32

Posted on 1997-08-17
3
Medium Priority
?
378 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 800 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…

715 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