#2 (RAD STUDIO) In www.devgear.co.kr 2016.05.18
(Humphery Kim) RAD Studio : h=p://tech.devgear.co.kr/ : h=p://blog.hjf.pe.kr/ Facebook : h=p://d.com/hjfactory : hskim@embarcadero.kr
3! 1 - RAD, 2-3 - 4 -
3?? :
6?. - h=ps://ko.wikipedia.org/wiki/ ( ),
6? : (Record) : (Field) (TDataSet),, SQL(Structured Query Language)
/ Open / Close / AcWve ( ) Next / Prior First / Last MoveBy(X: Integer) Fields[X: Integer] FieldByName[N: string] TField.As[ ] ) AsString, AsInteger var Name: string; Age: Integer; FDMemTable1.First; while not FDMemTable1.Eof do Name := FDMemTable1.FieldByName( Name ).AsString; Age := FDMemTable1.FieldByName( Age ).AsInteger; FDMemTable1.Next; end; end;
, dsinacwve : dsbrowse : dsinsert / dsedit : / dsinsert, dsedit Open / Close : / Insert : (dsinsert) Append : Edit : (dsedit) Post : Cancel : Delete :
#1 (1) FDMemTable1 Name UserData DataSource1.DataSet FDMemTable1 DBGrid1.DataSource DataSource1 procedure TForm1.FormCreate(Sender: TObject); UserData.FieldDefs.Add('ID', hinteger); UserData.FieldDefs.Add('Name', hstring, 30); UserData.FieldDefs.Add('Age', hinteger); end; procedure TForm1. UserDataAherOpen(DataSet: TDataSet); UserData.AppendRecord([1, ' ', 30]); UserData.AppendRecord([2, ' ', 40]); UserData.AppendRecord([3, ' ', 20]); End; procedure TForm1.CheckBox1Click(Sender: TObject); UserData.AcWve := CheckBox1.Checked; end;
#1 (2) 1. TFDMemTable 2. Fields Editor 3. 4. New field 5. 1. ID / Integer 2. Name / String / 30 3. Age / Integer
#1 (3) DBEdit1 ~ 3 DataSource : DataSource1 DataField : procedure TForm1.Bu=on1Click(Sender: TObject); UserData.First; End; procedure TForm1.Bu=on2Click(Sender: TObject); UserData.Last; End; procedure TForm1.Bu=on3Click(Sender: TObject); UserData.Prior; End; procedure TForm1.Bu=on4Click(Sender: TObject); UserData.Next; end;
#1 (4) procedure TForm1.Bu=on5Click(Sender: TObject); UserData.Append; end; procedure TForm1.Bu=on6Click(Sender: TObject); UserData.Post; end; procedure TForm1.Bu=on7Click(Sender: TObject); UserData.Delete; end;
#1 (4) UserData.First; while not UserData.Eof do Age := UserData.FieldByName('Age').AsInteger; Name := UserData.FieldByName('Name').AsString; procedure TForm1.Bu=on8Click(Sender: TObject); var Name, Msg: string; Age: Integer; if Age >= 30 then if Msg <> '' then // Msg := Msg + ', '; Msg := Msg + Name; end; UserData.Next; end; ShowMessage('30 ' + Msg + '.'); end;
FireDAC TFDConnecWon TFDQuery
#2 (1) SQLite Browser 1. SQLiteBrowser 2. New Database 3. UserData.db 4. Table : UserData 5. Fields 1. ID : Integer / PK / AI 2. Name : Varchar(30) 3. Age : Integer 4. OK 6. Write Changes( )
#2 (2) 1. TFDConnecWon 2. FDConnecWon1 3. ConnecWon Editor 1. Database : UserData.db 2. LockingMode : Normal
#2 (3) 1. TFDQuery 2. FDQuery1 3. Query Editor SQL 1. SELECT * FROM UserData 2. Execute 3. OK 4. TFDMemTable 5. TFDQuery UserData 6. DataSource1.DataSet 7.
- 3-3 [ ] h=p://tech.devgear.co.kr/402210 19
h=p://devgear.co.kr/edu, 9 (2 ) (4 ) (2 ) & ios DB : 2 (2 ), (3 ) ( 1 )! UI/UX, Push (2 ) 21 (1 )
(1), h=p://tech.devgear.co.kr/421276,.,., 22.
(2) /ios with 1, 2,, h=p://tech.devgear.co.kr/406570 23
: h=p://devgear.co.kr/ : h=p://tech.devgear.co.kr/ : h=p://docwiki.embarcadero.com ( ) : h=p://www.delmadang.com/ ( ) : h=p://borlandforum.com : h=p://cafa.naver.com/delphifmx : h=p://blog.hjf.pe.kr/ 24
QuesEons?
. h=p://tech.devgear.co.kr h=p://www.devgear.co.kr h=p://www.facebook.com/devgear