Solved

Create a Paradox Table with BC5 and BDE32

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

705 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

18 Experts available now in Live!

Get 1:1 Help Now