意思如下:
if {table in edit mode} then......
if {table in insert mode} then.......
if {table in edit mode} then......
if {table in insert mode} then.......
解决方案 »
- 在Delphi中如何取ACCESS数据库中日期型字段的数值?
- 数据库备份与还原
- 散分~~ 回家过年了!高兴ing
- 不遍历文件夹,有没有办法获得文件夹内的文件数量?
- from.tag和edit.tag这两个属性指的是什么呀?
- 欢迎大家到偶的小庙去烧香啊,灌水啊…… :o)
- 关于QuickReport的preview的一个问题
- 下面一段簡單的代碼,誰能不能幫我改改 ?? 3層的是不是只能用Filter過濾條件,不能用select..過濾條件?
- 关于控件的copy问题
- TBDEClientDataSet问题请教!!!答者有分!!!!
- 关于SQL的query查询----很奇怪的问题!!!大虾指点!!!
- 怎样查找LISTVIEW里面的内容
可使用SQL提交怎么办?InTransaction?
你的目的是什么?
说出来,看看有没有别的解决方案?
property State: TDataSetState;
//
if table1.state=dsEdit then
....
if table1.state=dsInsert then
...
to 搂主。 例子如下:procedure TForm1.AppendNoteClick(Sender: TObject);var
Stream: TStream;
S: string;
begin
with Tasks do
begin Edit; if State = dsEdit then
begin
Stream := CreateBlobStream(FieldByName('Notes'), bmReadWrite);
try
Stream.Seek(0, 2); {Seek 0 bytes from the stream's end point}
S := ' This line will be added to the end.';
Stream.Write(PChar(S)^, Length(S));
Post;
finally
Stream.Free;
end;
end;
end;
end;
if table.state=dsinsert then//如果表处在插入状态
begin
执行代码
end;
if table.state=dsedit then//如果表处在编辑状态
begin
执行代码
end;
此State的属性值的类型如下:
type TDataSetState = (dsInactive, dsBrowse, dsEdit, dsInsert, dsSetKey, dsCalcFields, dsFilter, dsNewValue, dsOldValue, dsCurValue);可根据此属性来进行判断:
if DataSource.Satae = dsEdit then
......
if DataSource.Satae = dsInsert then
......