Can't delete Table1 !!

tree2000 2000-11-15 08:03:00
小弟欲做一快速报表。采用Table,QRChat,DBGrid,QuickRep.....,因为试验的需要,

添加的demo在正式运行前将delete.

程序如下:

if(Table1->Active)
{
Excutive=true;
Table1->Empty(?);
}
else
{
Table1->DatabaseName= "xxxx";
Table1->TableType="XXX";
Table1->TableName=" XXX";
Table1->EmptyTable();
}
运行后,Error提示“table1 is Locked....”

将executive ->false,Error 提示Table1 can't be Opened. !!!!

令人百思不得其解。一气之下,小弟将Table1 在设计期间的Active=false;

运行出错,不管。进入操作区,运行Delete按钮,终于Delete Table1's data.

可如果在设计时将Table1设为True,问题依旧!!!!

WHY???

小弟翻了好多书,都没有说得更详细。

Help!!






...全文
149 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Hank 2000-11-22
  • 打赏
  • 举报
回复
错了!如果要EmptyTable,应该首先关闭它,而且如果指定TableType很容易出错,再说,已经指定DatabaseName了还指定TableType干吗?你看你是怎么写的!
应该是:

if(Table1->Active)
{
Table1->Close();
Table1->EmptyTable();
}
else
{
Table1->DatabaseName="xxxx";
Table1->TableName=" XXX";
Table1->EmptyTable();
}
Ton2000 2000-11-20
  • 打赏
  • 举报
回复
tree2000,Thank you!
I study some thing from your answet!
tree2000 2000-11-18
  • 打赏
  • 举报
回复
Dear Withluck,

You didn't have good luck this time,but me.
I have scan many books and found the same way as you while the same result with me.So I am so angry to close BCB5.Then I go out to have a rest.---Of course,come back soon.When I open *.exe but don't open BCB5,the event come out:---what happened,do you know?I can delete table1's data!!I don't really believe myself,and try again.The same thing happena again.Of course ,the Exe file can't be opened with BCB5 which also open the source file at the same time.Why?
I think for a minute.Then I found the fact.
I don't know how to setup the BCB compiler environment to lead to the application is separated from BCB5,and when you build "=>" programme,the application will independ on running itself.Then the question appeared!
At the design time BCB5 setups table1->Active=true;but application setups Table1->active=false.Who is the first? It's BCB5.It makes Tables Active true.So the strange thing happens as the front.
My god.
withluck 2000-11-16
  • 打赏
  • 举报
回复
if(Table1->Active)
{
Table1->Active = false;
Table1->Excutive=true;
Table1->Active = true;
Table1->Empty(?);
}
else
{
Table1->DatabaseName= "xxxx";
Table1->TableType="XXX";
Table1->TableName=" XXX";
Table1->Excutive=true;
Table1->Active = ture;
Table1->EmptyTable();
}

try again!

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧