Jump to content
tobenschain

Indexes.Count is zero 

Recommended Posts

Can't figure out why BudSys_DB.Indexes.Count is zero 

 

  BudSys_Con := TFDConnection.Create(nil);
  with BudSys_Con do begin

    Params.DriverId := 'SQLite';
    Params.Database := sys_dir^+'BudSysDB'+'.sdb';
    ExecSQL('PRAGMA locking_mode = NORMAL');
    ExecSQL('PRAGMA journal_mode = OFF'); 

    Open;
    end;
  if BudSys_DB=nil then begin
    BudSys_DB := TFDTable.Create(nil);
    BudSys_DB.TableName := 'BudSysDB';
    BudSys_DB.IndexFieldNames := 'key';
    BudSys_DB.Connection := BudSys_Con;
    BudSys_DB.Open; end;

 

Share this post


Link to post
26 minutes ago, tobenschain said:

Can't figure out why BudSys_DB.Indexes.Count is zero 

 

From the Delphi Help file on TSQLTable.IndexFieldNames...

Quote

IndexFieldNames is also used to link this table as the detail in a master/detail relationship. Each of these fields must be matched to a corresponding field from the MasterFields property.

Instead of explicitly setting the sorting and linking fields using IndexFieldNames, you can indicate them using an existing index. To specify the sorting and linking fields implicitly through an index, use the IndexName property instead.

Note: The IndexName and IndexFieldNames properties are mutually exclusive. Setting one automatically clears the other.

 

Share this post


Link to post
Can't figure out why I can process Module Data but not BudSys,
 
BudSys works after I create it but not after I exit BudGen.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×