 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Bartek Guest
|
Posted: Sat Jan 01, 2005 5:49 pm Post subject: Paradox, creating table and changing index at runtime |
|
|
Hi,
I use this code to create paradox table:
// begining
with Table1 do begin
DatabaseName := 'TempAlias';
TableType := ttParadox;
TableName := 'c:table1.db';
with FieldDefs do begin
Clear;
Add('ID', ftAutoInc, 0, false);
Add('CM_KOD', ftInteger, 0, false);
Add('NAME', ftString, 20, false);
Add('SURNAME', ftString, 15, false);
Add('KW', ftString, 5, false);
Add('RZ', ftString, 5, false);
Add('GR', ftString, 5, false);
Add('ID_DYS', ftInteger, 0, false);
Add('OPIS', ftMemo, 0, false);
CreateTable;
end;
with IndexDefs do begin
Clear;
Add('', 'ID', [ixPrimary]);
Add('ind1', 'KW;RZ;GR',[ixCaseInsensitive]);
Add('ind2', SURNAME;NAME',[ixCaseInsensitive]);
end;
IndexName := 'ind1';
Active := true;
end;
// end
I got an error: 'Index doesn't exists'
'Index: ind1'
What should I do to correct this?
thanks a lot for any reply
Bartek
|
|
| Back to top |
|
 |
Alfred ten Hoeve Guest
|
Posted: Sat Jan 01, 2005 6:19 pm Post subject: Re: Paradox, creating table and changing index at runtime |
|
|
Put the line Table1.CreateTable after you add the indexes and just before
IndexName := 'ind1';
Alfred.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|