OSDN Git Service

データバインドは必要ありませんでした。settingはレコード数が常に1です。
authoryamat0jp <terukohietori@gmail.com>
Fri, 24 Jan 2020 13:21:28 +0000 (22:21 +0900)
committeryamat0jp <terukohietori@gmail.com>
Fri, 24 Jan 2020 13:21:28 +0000 (22:21 +0900)
tool/Unit2.dfm
tool/Unit2.pas

index 73ef4a3..20e1f42 100644 (file)
@@ -87,7 +87,6 @@ object Form1: TForm1
     Top = 222
     Width = 240
     Height = 25
-    DataSource = DataSource1
     TabOrder = 4
   end
   object DBGrid1: TDBGrid
@@ -280,38 +279,12 @@ object Form1: TForm1
       Control = Edit1
       Track = True
     end
-    object LinkControlToField1: TLinkControlToField
-      Category = #12463#12452#12483#12463' '#12496#12452#12531#12487#12451#12531#12464
-      DataSource = BindSourceDB2
-      FieldName = 'ng'
-      Control = Edit3
-      Track = True
-    end
-    object LinkControlToField5: TLinkControlToField
-      Category = #12463#12452#12483#12463' '#12496#12452#12531#12487#12451#12531#12464
-      DataSource = BindSourceDB2
-      FieldName = 'title'
-      Control = Edit4
-      Track = True
-    end
-    object LinkControlToField4: TLinkControlToField
-      Category = #12463#12452#12483#12463' '#12496#12452#12531#12487#12451#12531#12464
-      DataSource = BindSourceDB2
-      FieldName = 'title2'
-      Control = Memo1
-      Track = False
-    end
   end
   object FDGUIxWaitCursor1: TFDGUIxWaitCursor
     Provider = 'Forms'
     Left = 224
     Top = 160
   end
-  object DataSource1: TDataSource
-    DataSet = FDTable1
-    Left = 232
-    Top = 112
-  end
   object FDQuery1: TFDQuery
     CachedUpdates = True
     Connection = FDConnection1
@@ -369,17 +342,11 @@ object Form1: TForm1
       Size = 300
     end
   end
-  object BindSourceDB2: TBindSourceDB
-    DataSet = FDTable2
-    ScopeMappings = <>
-    Left = 368
-    Top = 304
-  end
   object FDTable3: TFDTable
     CachedUpdates = True
     Connection = FDConnection1
-    UpdateOptions.UpdateTableName = 'kainushi.dbname'
-    TableName = 'kainushi.dbname'
+    UpdateOptions.UpdateTableName = 'dbname'
+    TableName = 'dbname'
     Left = 440
     Top = 280
     object FDTable3dbnum: TIntegerField
@@ -394,4 +361,9 @@ object Form1: TForm1
       Size = 80
     end
   end
+  object DataSource1: TDataSource
+    DataSet = FDTable1
+    Left = 232
+    Top = 112
+  end
 end
index 7221d32..a38b6e5 100644 (file)
@@ -34,7 +34,6 @@ type
     LinkControlToField2: TLinkControlToField;
     FDGUIxWaitCursor1: TFDGUIxWaitCursor;
     DBNavigator1: TDBNavigator;
-    DataSource1: TDataSource;
     DBGrid1: TDBGrid;
     FDTable1ID: TIntegerField;
     FDTable1NAME: TWideStringField;
@@ -46,15 +45,11 @@ type
     Edit3: TEdit;
     Label2: TLabel;
     FDTable2: TFDTable;
-    BindSourceDB2: TBindSourceDB;
-    LinkControlToField1: TLinkControlToField;
     Edit4: TEdit;
-    LinkControlToField5: TLinkControlToField;
     Button5: TButton;
     Edit5: TEdit;
     UpDown1: TUpDown;
     Edit6: TEdit;
-    LinkControlToField4: TLinkControlToField;
     ComboBox1: TComboBox;
     Button6: TButton;
     Label3: TLabel;
@@ -72,6 +67,7 @@ type
     FDTable3: TFDTable;
     FDTable3dbnum: TIntegerField;
     FDTable3database: TWideStringField;
+    DataSource1: TDataSource;
     procedure Button1Click(Sender: TObject);
     procedure Button4Click(Sender: TObject);
     procedure Button3Click(Sender: TObject);
@@ -174,7 +170,7 @@ begin
   ListBox1.Items.Add('info');
   ListBox1.Items.Add('master');
   for i := 1 to 10 do
-    ListBox1.Items.Add('\8cf\8e¦\94Â'+i.ToString);
+    ListBox1.Items.Add('\8cf\8e¦\94Â' + i.ToString);
   list;
   itemsCopy;
 end;
@@ -262,17 +258,22 @@ begin
   FDTable2.Open;
   FDTable1.Refresh;
   FDTable2.Refresh;
-  if FDTable3.Exists = false then
-    FDTable3.CreateTable;
-  FDTable3.Open;
+  Edit4.Text := FDTable2.FieldByName('title').AsString;
+  Memo1.Lines.Text := FDTable2.FieldByName('title2').AsString;
+  Edit3.Text := FDTable2.FieldByName('ng').AsString;
   with FDTable3 do
-  if (Bof = true)and(Eof = true) then
   begin
-    list;
-    ApplyUpdates;
-    CommitUpdates;
+    if Exists = false then
+      CreateTable;
+    Open;
+    if (Bof = true) and (Eof = true) then
+    begin
+      list;
+      ApplyUpdates;
+      CommitUpdates;
+    end;
+    Refresh;
   end;
-  FDTable3.Refresh;
   combo;
   CheckBox1.Checked := FDTable2.FieldByName('mente').AsInteger = 1;
   UpDown1.Position := FDTable2.FieldByName('count').AsInteger;