Newbie Database question 
Author Message
 Newbie Database question

I created a Paradox database using the Database Desktop tool.
I set a specific field to have a key. If I understand this
correctly sorting is based on this field, as well as, uniqueness
of the field entry. My question is can you programatically change
the Paradox key so sorting will be based on a different field?

Rick Fiorentino



Fri, 22 May 1998 03:00:00 GMT  
 Newbie Database question
Hello,

Quote:

>I created a Paradox database using the Database Desktop tool.
>I set a specific field to have a key. If I understand this
>correctly sorting is based on this field, as well as, uniqueness
>of the field entry. My question is can you programatically change
>the Paradox key so sorting will be based on a different field?

>Rick Fiorentino

You can create secondary indexes based on the fields you'll want
sorted and use the switchindex method at run-time...

Hope this helps,

Chris.
---------------------------------------------------------
Christian Huwaert, Paradox & Delphi developer(tries to...)

Brussels, Belgium, Europe.



Fri, 22 May 1998 03:00:00 GMT  
 Newbie Database question
In Paradox tables, you can only have one unique index.  You can create
secondary indexes, but they cannot force unique keys.  If you create
these secondary indexes, you can easily change your view of the table
so that it is base on that particular index.  See TTable.IndexName and
TTable.IndexFields in the Delphi help.

Ryan Peterson


Quote:

>I created a Paradox database using the Database Desktop tool.
>I set a specific field to have a key. If I understand this
>correctly sorting is based on this field, as well as, uniqueness
>of the field entry. My question is can you programatically change
>the Paradox key so sorting will be based on a different field?

>Rick Fiorentino



Fri, 22 May 1998 03:00:00 GMT  
 Newbie Database question
Well, I got nuts on that one ! Make it the ttable indexname property !
and sorry again !

Quote:
>You can create secondary indexes based on the fields you'll want
>sorted and use the switchindex method at run-time...

OOPs !

Chris.



Sat, 23 May 1998 03:00:00 GMT  
 Newbie Database question

Quote:

>Hello,


>You can create secondary indexes based on the fields you'll want
>sorted and use the switchindex method at run-time...

>Hope this helps,

Hi Rick,

Chris is correct create a secondary indexes on the fields you what
and then used the following statement

Table1.IndexName:='MyIndexName';
{Do your Stuff}
Table1.IndexName:=''; {Go back to primary index}

If I remember correclty SwitchIndex is a Pardox (ObjectPal) Command;

Hope this helps

Huet Bartels



Mon, 25 May 1998 03:00:00 GMT  
 Newbie Database question

Quote:

>I created a Paradox database using the Database Desktop tool.
>I set a specific field to have a key. If I understand this
>correctly sorting is based on this field, as well as, uniqueness
>of the field entry. My question is can you programatically change
>the Paradox key so sorting will be based on a different field?
>Rick Fiorentino

Hi,

How are you bring in the information? If you want to change the sort
(in so far as displaying it to the user), the easiest way is to use a
TQuery component. Then typing the SQL to bring it in.

In example:

SELECT * FROM table_name ORDER BY column_to_order_by

Where table_name is the name of your table and column_to_order_by is
the column that you wish the data to be ordered by. Of course you can
also drop in a WHERE clause to further restrict your data...

Hope this helps.

Good Luck,
Allen



Thu, 28 May 1998 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Newbie database question

2. Newbie Question: Can't get access to Access Database

3. Newbie question...Empty database???

4. Creating and populating desktop databases - newbie questions

5. NEWBIE QUESTION: Where is the database manipulated?

6. Newbie question: login screen while trying to get access to MS-Access database

7. A newbie question

8. few newbie interbase dataset questions

9. newbie question

10. D3: Newbie question on InputBox and MessageDlg

11. newbie question

12. Newbie question

 

 
Powered by phpBB® Forum Software