Jump to content

tobenschain

Members
  • Content Count

    37
  • Joined

  • Last visited

Everything posted by tobenschain

  1. tobenschain

    Indexes.Count is zero 

    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;
  2. tobenschain

    Indexes.Count is zero 

    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.
  3. tobenschain

    how to delete TFDTable after open

    I am unable to delete a TFDTable after creating it. I tried Close and Disconnect.
  4. tobenschain

    how to delete TFDTable after open

    Many thanks for the example.
  5. tobenschain

    how to delete TFDTable after open

    I needed: try FDQuery1.ExecSQL('insert into MyTab(code, name) values (:code, :name)', [100, 'Tokyo']); except on E: EFDDBEngineException do begin // E.Message - Actual error message. For the DBMS messages only Message property is used. // E.ErrorCode - DBMS-specific error code. // E.Kind - DBMS-independent error code and other properties. if E.Kind = ekUKViolated then ShowMessage('Please enter unique value !'); raise; end; end;
  6. tobenschain

    how to delete TFDTable after open

    This is what I do Module_DB.Close; Module_DB.Disconnect; Module_Con.Close;
  7. tobenschain

    how to delete TFDTable after open

    Created, Copied and Deleted
  8. tobenschain

    how to delete TFDTable after open

    <<Have you checked what PRAGMA locking_mode is returning?>> I use: ExecSQL('PRAGMA locking_mode = NORMAL'); <<Can you delete the file before opening any connection?>> The file is being created.
  9. tobenschain

    how to delete TFDTable after open

    I tried Module_Con.Close; Didn't help
  10. tobenschain

    how to delete TFDTable after open

    I wasn't qualifying the Close statement
  11. tobenschain

    how to delete TFDTable after open

    if I try to delete the file manually it says it's still in use by the program
  12. tobenschain

    how to delete TFDTable after open

    The file should be gone.
  13. tobenschain

    how to delete TFDTable after open

    Using SQLite Module_DB: TFDTable; Module_DB.Close; Module_DB.Disconnect; SysUtils.DeleteFile('Test.DB');
  14. I'm getting "no such table" on the second.
  15. tobenschain

    FindNearest doesn't work

    I can't understand why this doesn't work Using FireDAC with SQLite and TFDTable, this returns RecNo of -1 findkeyw := '8F'; ABudSys_DB.IndexFieldNames := 'key'; ABudSys_DB.IndexName := 'KeyIdx'; ABudSys_DB.FindNearest([findkeyw]); This also returns RecNo of -1 findkeyw := '8F30'; ABudSys_DB.IndexFieldNames := 'key'; ABudSys_DB.IndexName := 'KeyIdx'; if ABudSys_DB.FindKey([findkeyw]) then File has for index 8A43 8F30 8F31
  16. tobenschain

    FindNearest doesn't work

    good to go thanks
  17. tobenschain

    FindNearest doesn't work

    KeyIdx is primary and unique other settings:
  18. tobenschain

    FindNearest doesn't work

    CachedUpdates false FetchOptions.Unidirectional false FetchOptions.CursorKind ckAutomatic FetchOptions.LiveWindowParanoic false
  19. tobenschain

    FindNearest doesn't work

    BudSys_DB.Params.RecordCountMode := cmTotal; doesn't help
  20. tobenschain

    FireDAC open error

    I do not understand why I am getting [FireDAC][Stan][Def]-254. Definition [C:\Prog2\employee.fdb] is not found in [C:\WINDOWS\FDConnectionDefs.ini] This is C:\WINDOWS\FDConnectionDefs.ini [EMPLOYEE] DriverID=FB Protocol=TCPIP Database=C:\Prog2\employee.fdb User_Name=sysdba Password=masterkey CharacterSet= ExtendedMetadata=True I am using XE7. This is my code var out_Table: TFDTable; out_Connection: TFDConnection; begin out_Table := TFDTable.Create(Application); with out_Table, FieldDefs do begin Clear; Add('key',ftString, 51); Add('data',ftString, 32{000}); Add('control',ftString, 32{000}); TableName := out_Table.Name; Convert := TConvert.Create(Application); Connection := Convert.FDConnection1; Active := true; end;
  21. tobenschain

    FireDAC open error

    backup worked
  22. tobenschain

    FireDAC open error

    i can create a sqlite file in memory but I cannot save it to disk
  23. tobenschain

    corrupt primary key?

    Using FireDAC i created a Fire Bird table. I use Next command to go through the entire file of 6,000 records. The keys essentially go like this: 'B040' 'B060' 'B070' 'Xƒ0000' 'Xƒ0010' 'Xƒ0020' 'X‡62170' 'X‡62180' 'X‡62190' 'Xˆ001' 'Xˆ002' 'Xˆ003' For some reason the Next command pulls up 'Xƒ0000' for a second time after 'X‡62190'. Are extended ASCII codes allowed?
  24. tobenschain

    corrupt primary key?

    where is charset specified?
  25. tobenschain

    corrupt primary key?

    using the default
×