線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:850
推到 Plurk!
推到 Facebook!

How can I save the current time in a field?

尚未結案
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-04-05 00:08:17 IP:217.36.xxx.xxx 未訂閱
what is the syntax when I want to save the current time when a record is made?
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-04-05 08:53:51 IP:218.16.xxx.xxx 未訂閱
If your field is a DateTime / TimeStamp field, you can use Table.FieldByName('FieldName').Value := now;
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-04-05 15:56:25 IP:217.36.xxx.xxx 未訂閱
it is the same doing it this way ADOTable1.FieldValues['FieldName']:=Now;
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-04-05 17:19:56 IP:218.16.xxx.xxx 未訂閱
very similar, but not 100% same. FieldValues['FieldName'] will generate exception when the value is null but FiledByName('FieldName').Value will not; actually, if you use ADOTable1.FieldValues['FieldName']:=Now; You would better use ADOTable1['FieldName']:=Now; They are the same.
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-04-05 17:24:34 IP:217.36.xxx.xxx 未訂閱
How can I decide which is better? May be the method i chose always make my program crash
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-04-05 17:35:39 IP:218.16.xxx.xxx 未訂閱
ADOTable1['FieldName']:=Now; is obvious shorter but I answer you question using ADOTable1.FieldByName('FieldName').Value := now; Which do you think I would prefer ?
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#7 引用回覆 回覆 發表時間:2003-04-05 17:38:13 IP:217.36.xxx.xxx 未訂閱
GOT IT! SIR 
系統時間:2024-06-29 15:26:54
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!