c++builder中的时间调用问题,还不懂。
在Accesss中我用了你们说的Data();
但在C++builder程序中用什么控件调用系统日期呢?
比如我在表book中定义了一个data字段(借书日期)和一个state字段(逻辑型,表示是否超期),借书时Access用data();自动加入时期到data字段。
关键在于程序(查看按钮)的代码
每次查看时,把借了过期的图书的state字段改变为true(默认为false);
可就是不知道怎么用什么来实现?????????
我连用什么控件都找不到。
请各位大前辈多多指点!!!!!!!!!
问题点数:0、回复次数:9Top
1 楼ljianq(泉深水清)回复于 2003-12-02 12:46:29 得分 0
TDateTime dtTemp=Now() ;//当前时间Top
2 楼matq2008(叶子.net)回复于 2003-12-02 12:53:21 得分 0
得写一段sql 语句了
你在access中执行的这个sql修改语句写好了
用ADOQuery1控件来用吧,与bcb无关
Top
3 楼hswu(hswu)回复于 2003-12-02 12:57:41 得分 0
Now();Top
4 楼constantine(飘遥的安吉儿)回复于 2003-12-02 13:40:52 得分 0
now()就可以了。Top
5 楼lglglglg2427(帅哥!)回复于 2003-12-02 14:05:27 得分 0
data()应该是Date();Top
6 楼ivanbai1310()回复于 2003-12-02 14:13:24 得分 0
bcb的时间控件在WIN32下的TDateTimePicker
Top
7 楼MartinWang(小磋磋)回复于 2003-12-03 14:08:25 得分 0
Now(),Date()!!:)Top
8 楼natasha(月不常满)回复于 2003-12-03 14:20:03 得分 0
Now();
Returns the current date and time, corresponding to Date( ) + Time( )
Date()
Use Date to obtain the current local date as a TDateTime value. The time portion of the value is 0 (midnight).
Time
Time returns the current time as a TDateTime object.Top
9 楼hy1080(老神经病)回复于 2003-12-03 23:37:13 得分 0
老大这个不好用么?
TSystemTime stTime;
GetLocalTime(&stTime);
stTime.wYear;//当前年
stTime.wMonth;//当前月
stTime.wDay;//当前日
stTime.wHour;//当前时
stTime.wMinute;//当前分
AnsiString tmp;
tmp=stTime.wYear;
tmp+="-";
tmp+=stTime.wMonth;
tmp+="-";
tmp+=stTime.wDay;
..
//写入tmp
.........
//回读
TStringList *Lines=new TStringList();
Lines->Delimiter = '-';
Lines->DelimitedText = tmp;
Year=Lines->Strings[0];
Month=Lines->Strings[1];
Day=Lines->Strings[2];
delete Lines;
//..........
下边自己判断吧
Top




