Jump to content

tobenschain

Members
  • Content Count

    24
  • Joined

  • Last visited

Posts posted by tobenschain


  1. 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

  2. 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?


  3. I am unable to delete a record. I get 

     

    '[FireDAC][Phys][FB]-312. Exact update affected [0] rows, while [1] was requested'.
     

    This is my code using TFDTable

     

        BudSys_DB.Active := true;
        BudSys_DB.RecNo := recnum;
        BudSys_DB.Delete;
     

    This gives the same error 

     

        if BudSys_DB.Locate('KEY', sysp^.key, []) then begin
          BudSys_DB.Delete;
          del_sys := true; end;
     


  4. unit2.dfm:

     

    object Form2: TForm2
      Left = 0
      Top = 0
      Caption = 'Form2'
      ClientHeight = 411
      ClientWidth = 710
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      OldCreateOrder = False
      OnCreate = FormCreate
      PixelsPerInch = 96
      TextHeight = 13
      object DBNavigator1: TDBNavigator
        Left = 68
        Top = 39
        Width = 240
        Height = 25
        TabOrder = 0
      end
      object DBGrid1: TDBGrid
        Left = 18
        Top = 83
        Width = 675
        Height = 311
        DataSource = DataSource1
        TabOrder = 1
        TitleFont.Charset = DEFAULT_CHARSET
        TitleFont.Color = clWindowText
        TitleFont.Height = -11
        TitleFont.Name = 'Tahoma'
        TitleFont.Style = []
      end
      object DataSource1: TDataSource
        DataSet = FDTable1
        Left = 345
        Top = 36
      end
      object Cprog2employeefdbConnection: TFDConnection
        Params.Strings = (
          'ConnectionDef=EMPLOYEE')
        LoginPrompt = False
        Left = 103
        Top = 159
      end
      object FDTable1: TFDTable
        Connection = Cprog2employeefdbConnection
        Left = 244
        Top = 163
      end
    end


  5. Now I get

     

    '[FireDAC][Phys][FB]I/O error during 
    "CreateFile (open)" operation for file ":C:\Prog2\employee.fdb"
    Error while trying to open file
    The filename, directory name, or volume label syntax is incorrect. 

     

    I set ConnectionDefName. I posted the wrong .pas code. It is now

     

    type
      TForm2 = class(TForm)
        DBNavigator1: TDBNavigator;
        DataSource1: TDataSource;
        Cprog2employeefdbConnection: TFDConnection;
        FDTable1: TFDTable;
        procedure FormCreate(Sender: TObject);
      end;

     

    procedure TForm2.FormCreate(Sender: TObject);
    begin  with FDTable1, FieldDefs do begin
        Clear;
        Add('key',ftString, 10);
        Add('data',ftString, 32{000});
        Add('control',ftString, 32{000}); end;
      Cprog2employeefdbConnection.Connected := true;
    end;

    image.thumb.png.5ad9fbdf89f36bbf521b3b9b8f761459.png

    image.thumb.png.a3f14c0151d0be07da5f476816272328.png

    image.thumb.png.63607cc9deee70e515f36684c4be4ec3.png
    image.thumb.png.e804f5f6e64ce5ecd84162e38f26f1b8.png

    image.thumb.png.0957b384830bc8d3588d28433a6c8a7c.png


  6. 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;
     

×