TARS數據存取
# PinToo之TARS數據存取
# 1. 說明
該功能可實現資料庫的連線進行數據存取的操作。通過PinToo智慧控制平臺,實現連線TARS進行數據存取的操作。在使用以下功能之前,請先確認是否有給予PinToo相應的許可權。建立PinToo與TARS的連線,在對應資料庫中建立一個名為Table_Test
的表,表結構如下方圖所示。同時在TARS中設定該資料庫的連線,使PinToo能夠與TARS進行數據互動。
建立語句示例如下:
--建立數據表 Table_Test
Create Table Table_Test(
FCode nvarchar(50) not null,
FName nvarchar(100)
)
GO
--建立表主索引 PK_Table_Test
CREATE UNIQUE NONCLUSTERED INDEX [PK_Table_Test] ON [dbo].[Table_Test]
([FCode] ASC)
WITH (PAD_INDEX = OFF,
STATISTICS_NORECOMPUTE = OFF,
SORT_IN_TEMPDB = OFF,
IGNORE_DUP_KEY = OFF,
DROP_EXISTING = OFF,
ONLINE = OFF,
ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
--插入測試用的數據
INSERT INTO Table_Test(FCode,FName)
VALUES('0101','小明')
INSERT INTO Table_Test(FCode,FName)
VALUES('0102','小王')
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
通過本範例學習,可以掌握與TARS的資料庫連線以及數據存取的基本操作。
# 2. 設計明細
開啟PinToo設計器,分別加入下插圖之控制元件。或者點選左上角的[打開模板Lib檔案]
,選擇模板檔案來打開對應模板。
①:TfxGridView元件,控制元件名稱為fxGridView1
。
②:TfxRFDataSet元件,控制元件名稱為fxRFDataSet1
。
③:TfxEdit元件,控制元件名稱為fxEditQuery
。
④:TfxDataSource元件,控制元件名稱為fxDataSource1
。
⑤:TfxSuperButton元件,控制元件名稱為fxSuperButtonQuery
。
⑥:TfxEdit元件,控制元件名稱為fxEditCode
。
⑦:TfxSuperButton元件,控制元件名稱為fxSuperButtonNew
。
⑧:TfxSuperButton元件,控制元件名稱為fxSuperButtonDelete
。
⑨:TfxEdit元件,控制元件名稱為fxEditName
。
⑩:TfxSuperButton元件,控制元件名稱為fxSuperButtonSave
。
fxRunFrame屬性設定
Height
:設定頁面高度=800
。Width
:設定頁面寬度=400
。
①fxGridView屬性設定
DataSource
:數據源,此處設定為fxDataSource1
。
其中fxGridView1
的表格設計方式如下:
雙擊fxGridView1
,打開表格設計器對話方塊。首先設定需要顯示的表格列數,修改右下角的ColCount
(列數),然後單擊表格處,表格列會自動產生。依次單擊各列的表格頭,修改Title
(表格列名稱)以及Field
(數據表中對應的欄位名)。修改完成後點選[確定]
。
③fxEditQuery屬性設定
Height
:設定控制元件高度=370
。Width
:設定控制元件寬度=30
。Name
:設定控制元件名稱=fxEditQuery
。TextPrompt
:設定文字框為空時的提示=請在此輸入
。TextSettings
:設定字型樣式。Font.Size
=16
,HorzAlign
=Leading
,VertAlign
=Center
。
④fxDataSource1屬性設定
DataSet
:設定數據源繫結的數據集,設定為fxRFDataSet1
。
⑤fxSuperButtonQuery屬性設定
Height
:設定控制元件高度=35
。Width
:設定控制元件寬度=35
。ButtonType
:設定按鈕型別,設定為TfxSvgButton
。Name
:設定控制元件名稱=fxSuperButtonQuery
。ButtonType.SvgData
:設定SVG數據,其數據內容如下。
<path d="M30.9545021057129,27.6716804504395 L24.128978729248,20.7876682281494 C24.0485534667969,20.7090625762939 23.9608116149902,20.6469173431396 23.8785514831543,20.5811080932617 C25.0301551818848,18.7970409393311 25.704662322998,16.6729774475098 25.704662322998,14.3843994140625 C25.704662322998,8.09629249572754 20.6504135131836,3 14.411660194397,3 C8.17656421661377,3 3.11865997314453,8.09629249572754 3.11865997314453,14.3843994140625 C3.11865997314453,20.6725082397461 8.17656421661377,25.768798828125 14.4116611480713,25.768798828125 C16.5982933044434,25.7690811157227 18.7369613647461,25.127799987793 20.562671661377,23.9244117736816 C20.626651763916,24.0121536254883 20.6869735717773,24.0980644226074 20.763744354248,24.176664352417 L27.5910949707031,31.0606803894043 C28.5068702697754,31.9894599914551 30.0021743774414,32 30.9309539794922,31.0842247009277 C30.9388580322266,31.0764312744141 30.946704864502,31.0685844421387 30.9544982910156,31.0606803894043 C31.8813400268555,30.1211223602295 31.8813400268555,28.6112403869629 30.9544982910156,27.6716823577881 M14.411660194397,22.173246383667 C10.1525640487671,22.173246383667 6.68496513366699,18.6782283782959 6.68496513366699,14.3844013214111 C6.68496513366699,10.0887470245361 10.1507349014282,6.59372901916504 14.411660194397,6.59372901916504 C18.6707572937012,6.59372901916504 22.138355255127,10.0905742645264 22.138355255127,14.3844013214111 C22.138355255127,18.6800556182861 18.6707572937012,22.173246383667 14.411660194397,22.173246383667 Z" p-id="2193" fill="Darkslateblue" stroke="Null"></path>
1⑥fxEditCode屬性設定
Height
:設定控制元件高度=370
。Width
:設定控制元件寬度=30
。Name
:設定控制元件名稱=fxEditCode
。TextSettings
:設定字型樣式。Font.Size
=16
,HorzAlign
=Leading
,VertAlign
=Center
。
⑦fxSuperButtonNew屬性設定
Height
:設定控制元件高度=100
。Width
:設定控制元件寬度=100
。Opacity
:設定控制元件的透明度=0.9
。ButtonType
:設定按鈕型別,設定為TfxSvgButton
。Name
:設定控制元件名稱=fxSuperButtonNew
。ButtonType.SvgData
:設定SVG數據,其數據內容如下。
<path d="M44.1782836914063,8.37389183044434 L44.1782836914063,26.2868690490723 C44.1782836914063,27.869758605957 42.8950881958008,29.1529541015625 41.3122177124023,29.1529541015625 L22.5931453704834,29.1529541015625 L22.5931453704834,69.4645919799805 C22.5931453704834,71.2429885864258 22.6977577209473,71.7845993041992 22.9933242797852,72.337287902832 C23.2113208770752,72.7448120117188 23.5150413513184,73.0485229492188 23.9225578308105,73.2665328979492 C24.4752616882324,73.5620803833008 25.0168609619141,73.6667022705078 26.7952613830566,73.6667022705078 L59.0460548400879,73.6667022705078 C60.5300559997559,73.6667022705078 61.7330055236816,74.8696517944336 61.7330055236816,76.3536529541016 C61.7330055236816,77.837646484375 60.5300559997559,79.0405960083008 59.0460548400879,79.0405960083008 L26.7952613830566,79.0405960083008 C24.2055854797363,79.0405960083008 22.8259239196777,78.7741394042969 21.3882293701172,78.0052261352539 C20.0442199707031,77.2864761352539 18.9733810424805,76.2157211303711 18.2546234130859,74.8716125488281 C17.4857082366943,73.4339218139648 17.2192535400391,72.0542755126953 17.2192535400391,69.4645919799805 L17.2192535400391,27.1885242462158 C17.2192535400391,25.6703948974609 17.2772903442383,24.9493045806885 17.4752292633057,24.1176090240479 C17.6752281188965,23.2774887084961 18.0010662078857,22.5143985748291 18.469669342041,21.7889270782471 C18.9335250854492,21.0707912445068 19.4142208099365,20.5302658081055 20.5108528137207,19.4803886413574 L34.5982475280762,5.99397563934326 C35.6527900695801,4.98431015014648 36.1817512512207,4.5483980178833 36.8757057189941,4.12842798233032 C37.5813865661621,3.70138263702393 38.3147468566895,3.40689325332642 39.1198387145996,3.2274055480957 C39.9115943908691,3.05096220970154 40.5949745178223,3 42.0549697875977,3 L62.2778282165527,3 C64.8675079345703,3 66.2471771240234,3.26645541191101 67.6848602294922,4.03536939620972 C69.0288696289063,4.75412845611572 70.0997009277344,5.82487678527832 70.8184661865234,7.16897583007813 C71.5873870849609,8.6066722869873 71.8538360595703,9.98633003234863 71.8538360595703,12.5760068893433 L71.8538360595703,44.0207252502441 C71.8538360595703,45.5047187805176 70.6508941650391,46.7076683044434 69.1668853759766,46.7076683044434 C67.6828918457031,46.7076683044434 66.4799346923828,45.5047187805176 66.4799346923828,44.0207252502441 L66.4799346923828,12.5760097503662 C66.4799346923828,10.7976093292236 66.3753356933594,10.2560110092163 66.0797576904297,9.7033052444458 C65.8617553710938,9.29578495025635 65.5580444335938,8.99206924438477 65.1505279541016,8.77406883239746 C64.5978240966797,8.4785041809082 64.0562286376953,8.37389183044434 62.2778282165527,8.37389183044434 L44.1782836914063,8.37389183044434 Z M38.8043937683105,9.41320419311523 C38.639705657959,9.56604671478271 38.4765129089355,9.72011089324951 38.3144493103027,9.87573337554932 L24.2270812988281,23.3622207641602 C24.0827865600586,23.5000782012939 23.9392242431641,23.6392135620117 23.7969207763672,23.7791309356689 L38.8043937683105,23.7791309356689 L38.8043937683105,9.41320419311523 Z M66.7486419677734,63.1876106262207 L66.7486419677734,55.1267776489258 C66.7486419677734,53.6427764892578 67.9515838623047,52.4398231506348 69.4355773925781,52.4398231506348 C70.9195861816406,52.4398231506348 72.1225280761719,53.6427764892578 72.1225280761719,55.1267776489258 L72.1225280761719,63.1876106262207 L80.0938110351563,63.1876106262207 C81.5778045654297,63.1876106262207 82.7807464599609,64.3905563354492 82.7807464599609,65.8745651245117 C82.7807464599609,67.3585586547852 81.5778045654297,68.5615081787109 80.0938110351563,68.5615081787109 L72.1225280761719,68.5615081787109 L72.1225280761719,76.5327758789063 C72.1225280761719,78.0167846679688 70.9195861816406,79.2197265625 69.4355773925781,79.2197265625 C67.9515838623047,79.2197265625 66.7486419677734,78.0167846679688 66.7486419677734,76.5327758789063 L66.7486419677734,68.5615081787109 L58.6877975463867,68.5615081787109 C57.203800201416,68.5615081787109 56.000846862793,67.3585586547852 56.000846862793,65.8745651245117 C56.000846862793,64.3905563354492 57.203800201416,63.1876106262207 58.6877975463867,63.1876106262207 L66.7486419677734,63.1876106262207 Z" p-id="1912" fill="Darkslateblue" stroke="Null"></path>
1⑧fxSuperButtonDelete屬性設定
Height
:設定控制元件高度=100
。Width
:設定控制元件寬度=100
。Opacity
:設定控制元件的透明度=0.9
。ButtonType
:設定按鈕型別,設定為TfxSvgButton
。Name
:設定控制元件名稱=fxSuperButtonDelete
。ButtonType.SvgData
:設定SVG數據,其數據內容如下。
<path d="M35.0198364257813,9.15834045410156 L64.9596405029297,9.15834045410156 C66.6634521484375,9.15834045410156 68.038818359375,7.78297853469849 68.038818359375,6.07917022705078 C68.038818359375,4.37536239624023 66.6634521484375,3 64.9596405029297,3 L35.0198364257813,3 C33.3160247802734,3 31.9406642913818,4.37536239624023 31.9406642913818,6.07917022705078 C31.9406642913818,7.78297853469849 33.3262939453125,9.15834045410156 35.0198364257813,9.15834045410156 Z M35.0198364257813,66.0819320678711 C36.7236404418945,66.0819320678711 38.099006652832,64.7065658569336 38.099006652832,63.0027618408203 L38.099006652832,26.1964168548584 C38.099006652832,24.4926090240479 36.7236404418945,23.1172466278076 35.0198364257813,23.1172466278076 C33.3160247802734,23.1172466278076 31.9406642913818,24.4926090240479 31.9406642913818,26.1964168548584 L31.9406642913818,63.0027656555176 C31.9406642913818,64.7065734863281 33.3262939453125,66.0819396972656 35.0198364257813,66.0819396972656 Z M49.9948654174805,66.0203552246094 C51.698673248291,66.0203552246094 53.0740356445313,64.6449890136719 53.0740356445313,62.9411849975586 L53.0740356445313,26.1348323822021 C53.0740356445313,24.4310245513916 51.698673248291,23.0556621551514 49.9948654174805,23.0556621551514 C48.2910614013672,23.0556621551514 46.9156951904297,24.4310245513916 46.9156951904297,26.1348323822021 L46.9156951904297,62.9411849975586 C46.9156951904297,64.6449890136719 48.2910575866699,66.0203552246094 49.9948654174805,66.0203552246094 Z M64.9596405029297,66.0819320678711 C66.6634368896484,66.0819320678711 68.0388031005859,64.7065658569336 68.0388031005859,63.0027618408203 L68.0388031005859,26.1964168548584 C68.0388031005859,24.4926090240479 66.6634368896484,23.1172466278076 64.9596405029297,23.1172466278076 C63.2558288574219,23.1172466278076 61.8804626464844,24.4926090240479 61.8804626464844,26.1964168548584 L61.8804626464844,63.0027656555176 C61.8804626464844,64.7065734863281 63.2660903930664,66.0819396972656 64.9596405029297,66.0819396972656 Z" p-id="2301" fill="Darkslateblue" stroke="Null"></path> <path d="M82.849609375,11.9090662002563 L17.1503829956055,11.9090662002563 C15.4465751647949,11.9090662002563 14.0712127685547,13.2844285964966 14.0712127685547,14.9882364273071 C14.0712127685547,16.6920433044434 15.4465751647949,18.0674057006836 17.1503829956055,18.0674057006836 L22.8263206481934,18.0674057006836 L22.8263206481934,69.9822158813477 C22.8263206481934,75.0731048583984 26.9729385375977,79.2197265625 32.0638275146484,79.2197265625 L67.9361724853516,79.2197265625 C73.0270538330078,79.2197265625 77.1736755371094,75.0731048583984 77.1736755371094,69.9822158813477 L77.1736755371094,18.0674057006836 L82.849609375,18.0674057006836 C84.5534210205078,18.0674057006836 85.9287872314453,16.6920433044434 85.9287872314453,14.9882364273071 C85.9287872314453,13.2844285964966 84.5431671142578,11.9090662002563 82.849609375,11.9090662002563 Z M71.0050811767578,69.9822158813477 C71.0050811767578,71.6757583618164 69.6194458007813,73.0613861083984 67.9259185791016,73.0613861083984 L32.0638275146484,73.0613861083984 C30.3702869415283,73.0613861083984 28.9846591949463,71.6757583618164 28.9846591949463,69.9822158813477 L28.9846591949463,18.0674057006836 L71.0153350830078,18.0674057006836 L71.0153350830078,69.9822158813477 Z" p-id="2302" fill="Darkslateblue" stroke="Null"></path>
1
2⑨fxEditName屬性設定
Height
:設定控制元件高度=370
。Width
:設定控制元件寬度=30
。Name
:設定控制元件名稱=fxEditName
。TextSettings
:設定字型樣式。Font.Size
=16
,HorzAlign
=Leading
,VertAlign
=Center
。
⑩fxSuperButtonSave屬性設定
Height
:設定控制元件高度=100
。Width
:設定控制元件寬度=100
。Opacity
:設定控制元件的透明度=0.9
。ButtonType
:設定按鈕型別,設定為TfxSvgButton
。Name
:設定控制元件名稱=fxSuperButtonSave
。ButtonType.SvgData
:設定SVG數據,其數據內容如下。
<path d="M19.640832901001,9.67626857757568 C19.1696357727051,9.9283332824707 18.8184680938721,10.2795009613037 18.5664043426514,10.7506971359253 C18.2246570587158,11.389762878418 18.1036987304688,12.0159864425659 18.1036987304688,14.0722618103027 L18.1036987304688,68.1474609375 C18.1036987304688,70.203742980957 18.2246570587158,70.8299560546875 18.5664043426514,71.4690246582031 C18.8184680938721,71.9402160644531 19.1696357727051,72.291389465332 19.640832901001,72.5434494018555 C20.2798976898193,72.8852005004883 20.9061222076416,73.0061569213867 22.9623985290527,73.0061569213867 L77.03759765625,73.0061569213867 C79.093879699707,73.0061569213867 79.7200927734375,72.8852005004883 80.3591613769531,72.5434494018555 C80.8303527832031,72.291389465332 81.181526184082,71.9402160644531 81.4335861206055,71.4690246582031 C81.7753372192383,70.8299560546875 81.8962936401367,70.2037353515625 81.8962936401367,68.1474609375 L81.8962936401367,25.0763816833496 C81.8962936401367,23.7840614318848 81.8657455444336,23.3900203704834 81.7757568359375,22.9997024536133 C81.711540222168,22.7207145690918 81.6189575195313,22.4974384307861 81.4671478271484,22.2545928955078 C81.2548522949219,21.9150218963623 80.9977188110352,21.6148014068604 80.0839004516602,20.7009925842285 L70.4088592529297,11.0258541107178 C69.4950561523438,10.1120452880859 69.1948394775391,9.85490798950195 68.8552551269531,9.64250755310059 C68.6125259399414,9.49079322814941 68.3892517089844,9.39821243286133 68.1101531982422,9.33390045166016 C67.7198333740234,9.24401187896729 67.3257904052734,9.21346187591553 66.0334777832031,9.21346187591553 L22.9623985290527,9.21346187591553 C20.9061222076416,9.21346187591553 20.2798976898193,9.33441925048828 19.640832901001,9.67616558074951 Z M22.9623985290527,3 L66.0334777832031,3 C67.7550506591797,3 68.5671691894531,3.06296420097351 69.5057220458984,3.27919602394104 C70.4570236206055,3.49843192100525 71.3221588134766,3.85685086250305 72.1499176025391,4.37444067001343 C72.9664764404297,4.88519668579102 73.5852432250977,5.41490173339844 74.8025817871094,6.63224315643311 L84.4776153564453,16.3072834014893 C85.6949615478516,17.5247287750244 86.2246627807617,18.1433925628662 86.7354278564453,18.9599571228027 C87.2530136108398,19.7877082824707 87.6114273071289,20.6528415679932 87.8306579589844,21.6041374206543 C88.0469055175781,22.5426959991455 88.10986328125,23.3548107147217 88.10986328125,25.0764846801758 L88.10986328125,68.1474609375 C88.10986328125,71.1417770385742 87.8017654418945,72.7370071411133 86.912712097168,74.3993377685547 C86.0816421508789,75.9533538818359 84.8436050415039,77.1915054321289 83.2894744873047,78.022575378418 C81.6271438598633,78.9116287231445 80.0319137573242,79.2197265625 77.03759765625,79.2197265625 L22.9623985290527,79.2197265625 C19.9680805206299,79.2197265625 18.3728504180908,78.9116287231445 16.7105159759521,78.022575378418 C15.1565036773682,77.1915054321289 13.9183464050293,75.9534683227539 13.0872831344604,74.3993377685547 C12.1982250213623,72.7370071411133 11.89013671875,71.1417770385742 11.89013671875,68.1474609375 L11.89013671875,14.0722618103027 C11.89013671875,11.0779457092285 12.1982269287109,9.48271560668945 13.0872831344604,7.82038116455078 C13.9183464050293,6.2663688659668 15.1563997268677,5.02821159362793 16.7105159759521,4.19714832305908 C18.3728523254395,3.30808997154236 19.9680805206299,3.00000166893005 22.9623985290527,3.00000166893005 Z M66.776611328125,9.1591968536377 L72.9901885986328,9.1591968536377 L72.9901885986328,29.8385620117188 C72.9901885986328,32.9780693054199 72.5910720825195,34.6884536743164 71.4646453857422,36.4312591552734 C70.4556732177734,37.9923133850098 68.9964218139648,39.1998176574707 67.2031707763672,39.9933891296387 C65.3242034912109,40.8250732421875 63.5411186218262,41.10986328125 60.0165786743164,41.10986328125 L39.9834213256836,41.10986328125 C36.4588813781738,41.10986328125 34.6757965087891,40.8249702453613 32.7968139648438,39.9934921264648 C31.0035781860352,39.1998138427734 29.5443229675293,37.9923095703125 28.5353450775146,36.4312553405762 C27.4089279174805,34.6883506774902 27.0098094940186,32.9780654907227 27.0098094940186,29.8385620117188 L27.0098094940186,9.20113754272461 L33.2233734130859,9.20113754272461 L33.2233734130859,29.8384571075439 C33.2233734130859,31.0040187835693 33.2886161804199,31.7646636962891 33.4046020507813,32.2610244750977 C33.4770965576172,32.5721130371094 33.5606689453125,32.7595596313477 33.75390625,33.0584335327148 C34.086540222168,33.5732269287109 34.5960540771484,33.994815826416 35.3114395141602,34.311393737793 C36.2833480834961,34.7414779663086 37.2519378662109,34.8963012695313 39.9834213256836,34.8963012695313 L60.0165710449219,34.8963012695313 C62.7480545043945,34.8963012695313 63.7167472839355,34.7414817810059 64.6886596679688,34.311393737793 C65.4039306640625,33.994815826416 65.9134521484375,33.5732269287109 66.2461776733398,33.058536529541 C66.4393157958984,32.7595596313477 66.5228881835938,32.5721168518066 66.5954895019531,32.2611274719238 C66.7112579345703,31.7646636962891 66.776611328125,31.0040187835693 66.776611328125,29.8385620117188 L66.776611328125,9.1591968536377 Z" p-id="2499" fill="Darkslateblue" stroke="Null"></path>
1
# 3. 程式設計
點選程式設計界面右下角的按鈕,切換至單元選擇界面,勾選需要使用的單元。需要引用DB
,DBClient
,TARSCompClient
單元。
# 3.1. 程式初始設定
將查詢內容SQL語句傳遞給控制元件,打開數據集。
Begin
//打開RFDataSet1數據
fxRFDataSet1.SQL.Text := 'Select FCode,FName From Table_Test';
fxRFDataSet1.OpenData;
End.
2
3
4
5
# 3.2. 事件設定
- ⑤fxSuperButtonQuery-OnClick事件
點選按鈕,根據查詢文字框中的內容對數據進行篩選顯示。
Procedure fxSuperButtonQueryOnClick(Sender: TObject);
//查詢
var
vSQL:string;
begin
//數據查詢
vSQL := 'Select FCode,FName From Table_Test ' ;
if fxEditQuery.Text <> '' then
vSQL := vSQL + 'where 1=1 and FName = ' + QuotedStr(fxEditQuery.Text);
fxRFDataSet1.SQL.Text := vSQL;
fxRFDataSet1.OpenData;
end;
2
3
4
5
6
7
8
9
10
11
12
- ⑦fxSuperButtonNew-OnClick事件
點選新增按鈕,將記錄新增至數據集。
Procedure fxSuperButtonNewOnClick(Sender: TObject);
//新增記錄
Begin
if not fxRFDataSet1.Active then exit;
fxRFDataSet1.Append; //新增一條記錄
fxRFDataSet1.FieldByName('FCode').AsString := fxEditCode.Text;
fxRFDataSet1.FieldByName('FName').AsString := fxEditName.Text;
fxRFDataSet1.Post;
End;
2
3
4
5
6
7
8
9
- ⑧fxSuperButtonDelete-OnClick事件
點選刪除按鈕,將目前選擇的行進行刪除。
Procedure fxSuperButtonDeleteOnClick(Sender: TObject);
//刪除目前選中的記錄
Begin
//判斷數據集是否為空
if fxRFDataSet1.IsEmpty then
exit;
//刪除目前行
fxRFDataSet1.Delete;
End;
2
3
4
5
6
7
8
9
- ⑩fxSuperButtonSave-OnClick事件
點選儲存按鈕,將數據集的修改資訊提交至資料庫。
Procedure fxSuperButtonSaveOnClick(Sender: TObject);
//提交數據儲存
Begin
//提交數據
if fxRFDataSet1.ApplyUpdates(-1) = 0 then
begin
Showmessage('數據儲存成功!');
end;
End;
2
3
4
5
6
7
8
9
# 4. 運行結果
使用滑鼠在 PinToo 功能表,點選[儲存至資料庫]
按鈕,將其儲存至資料庫。由於該程式直接使用帳套設定中的設定進行連線,故在設計器端不能運行,直接將其同步至設備上即可。
通過同步中心,將程式上傳至手機PinToo運行;同步時,請確保手機已經運行PinToo,並且已經登陸。
程式啟動時會打開對應的表格。點選新增按鈕,新增一行記錄並根據編號和名稱的編輯框賦值。點選刪除按鈕刪除選擇行的記錄。點選儲存按鈕,將編輯框中的數值提交至當前選擇的數據記錄位置並提交數據。在查詢內容的輸入框中輸入內容,點選查詢按鈕,下方的表格顯示條件查詢的結果。