如何判断?
我POST后现在执行TTABLE的LAST,可总是取不到新加的内容
我POST后现在执行TTABLE的LAST,可总是取不到新加的内容
解决方案 »
- EXCEL导入数据问题,急,救命呀
- 窗口显示时怎么使dbgrid第一行获得焦点
- 提个问题!!在线等答案!!
- 如何给控件添加一个新的事件?
- 怎样把查询的值付给ListView控件!
- Eastunfail(恶鱼杀手) 进来,昨天的问题~~~
- 知道了窗体的句柄,请问如何通过这个句柄获得该应用程序的完整路径?
- delphi编译器代码讨论
- 請問怎麼把一個Form設為模态形式????
- 有谁见过网海拾贝,它是如何将整个保存下下来的?
- 在delphi中怎样设置条件断点,以前试过但执行到那儿却停不下来?
- ADO害死我了:我用DELPHI编写的ACCESS数据库在网络上共享,可是户多了就出错,怎么办?,请高手指点!
好像会把新插入的这条记录作为当前的活动记录,直接调用fieldbyname().value 就可以取得
该记录的字段值吧
一下是help里面关于append的说明:
Adds a new, empty record to the end of the dataset.procedure Append;DescriptionCall Append to:-->1 Open a new, empty record at the end of the dataset.
-->2 Set the active record to the new record.After a call to Append, an application can enable users to enter data in the fields of the record, and can then post those changes to the database using Post (or ApplyUpdates if cached updating is enabled). A newly appended record is posted to the database in one of three ways:For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.
For unindexed Paradox and dBASE tables, the record is added to the end of the dataset.
For SQL databases, the physical location of the appended record is implementation-specific. For indexed tables, the index is updated with the new record information.
2.再都一次变量好了
http://www.csdn.net/expert/topic/111/111753.shtm,是我在BCB组里的问题
你的库总有个关键字吧。
Table.Post;
Table.Findkey([关键字]);
dm->Table1->Append();
dm->Table1->FieldByName("root")->Value=-1;
dm->Table1->FieldByName("title")->Value=title;
dm->Table1->FieldByName("author")->Value=author;
dm->Table1->FieldByName("time")->Value=StrToDate(ptime);
dm->Table1->Post();
// dm->Table1->UpdateRecord(); sql="select * from "+Form1->TreeList1->Selected->Text;
sql=sql+"data where 1=2";
dm->adsImpcon->Active=false;
dm->adsImpcon->CommandText=sql;
dm->adsImpcon->Active=true;
dm->adsImpcon->Append();
// dm->Table1->Refresh();
dm->Table1->Last();
dm->Table1->Next();//往第二个表中增加记录
int aaa=dm->Table1->FieldByName("id")->AsInteger;
dm->adsImpcon->FieldByName("id")->Value=aaa;
dm->adsImpcon->FieldByName("content")->Value=addFile->Text;
dm->adsImpcon->Post();
adsImpcon是什么元件?是TClientDataset?如果是,是远程数据库连接,还是本地表?如果是本地表,不能使用CommandText属性查询;如果是Midas远程数据操作,在adsImpcon->Post后,应该使用adsImpcon->ApplyUpdates(-1);
bde的缓存中,即使post也没有用。我们当时是用bde的api解决这个问题,在
table的afterpost中调用dbiSaveChange(?),让数据真正写入。不知道对你是否有
帮助。
http://www.csdn.net/expert/topic/111/111753.shtm