Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paradox 9 and restructuring programmatically

Status
Not open for further replies.

pal

Programmer
Jun 24, 2000
4
US
I have created a table using a query within Opal.&nbsp;&nbsp;There are no memo fields in the table, no validity checks and I have tried creating the table and calling the field structure without using aliases.&nbsp;&nbsp;No matter what I do, I can't create a key on the first field of the table.&nbsp;&nbsp;If I restructure the table manually, it works.&nbsp;&nbsp;I get no error when it fails programmatically.&nbsp;&nbsp;I've been able to use this code to rename fields, change the table version and other things.<br><br>To add the field as a key I enum the table structure, open the table containing the structure and add an &quot;*&quot; to the key of the first field.&nbsp;&nbsp;The structure table reflects this change but when I assign that structure table to a dynamic array and use the restructure command, everything applies to the table except the key.<br><br>Corel doesn't have an answer in their knowledge base and I've checked other newsgroups with no luck.<br><br>Thanks in advance for any help from this group.<br><br>Pat<br>
 
For certain the reStructure method works for setting a key - it even generates a KeyViol.db table if all records are not unique. I assume you are using something like :<br><br>tcFlds.open (&quot;:pRIV:FLD_STR.DB&quot;)<br>tcFlds.edit()<br>tcFlds.&quot;Key&quot; = &quot;*&quot;&nbsp;&nbsp;;already on first record<br>tcFlds.endEdit()<br>tcFlds.close()<br>dynNewStru[&quot;FIELDSTRUCT&quot;] = &quot;:pRIV:FLD_STR.DB&quot;<br>tbl.reStructure(dynNewStru)<br>
 
As I stated in my post, I did exactly what you are saying.&nbsp;&nbsp;I opened the table containing the structure to verify that the &quot;*&quot; was in the &quot;Key&quot; field of the first record.&nbsp;&nbsp;It didn't work.
 
There must be something preventing the restructure (password, rights, locks, ...). Try setting errorTrapOnWarnings (Yes) befor the restructure and see do you get any errors.<br>HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top