BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Paradox, creating table and changing index at runtime

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
Bartek
Guest





PostPosted: Sat Jan 01, 2005 5:49 pm    Post subject: Paradox, creating table and changing index at runtime Reply with quote



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





PostPosted: Sat Jan 01, 2005 6:19 pm    Post subject: Re: Paradox, creating table and changing index at runtime Reply with quote



Put the line Table1.CreateTable after you add the indexes and just before
IndexName := 'ind1';

Alfred.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.