CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
英特尔®游戏设计大赛100美元现金周周送 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C++ Builder >  基础类

Query->Insert()问题。急!!!!

楼主bpaibgy(东东)2003-07-03 09:51:20 在 C++ Builder / 基础类 提问

Query的数据显示在DBGrid中,插入(insert)一条记录,位置在当前记录的前一条,  
  但当指针移到另一条记录时,刚插入的这条记录就跑到了末尾(DBGrid显示如此)。  
  问怎么样解决不让它跑到最后一条。 问题点数:50、回复次数:4Top

1 楼bpaibgy(东东)回复于 2003-07-03 12:05:38 得分 0

没有知道为什么insert以后记录会跑到最后吗?  
  Top

2 楼pazee(耙子)(今年过年不收礼,收礼只收尿不湿)回复于 2003-07-03 12:08:13 得分 20

这是索引的问题。  
  你合理的设置索引。比如按照插入的时间Top

3 楼nanhui(晖)回复于 2003-07-03 12:37:51 得分 20

Description  
   
  Call   Insert   to:  
   
  1 Open   a   new,   empty   record   in   the   dataset.  
  2 Set   the   active   record   to   the   new   record.  
   
  After   a   call   to   Insert,   an   application   can   allow   users   to   enter   data   in   the   fields   of   the   record,   and   then   post   those   changes   to   the   database   or   change   log   using   Post.   (Client   datasets   can   subsequently   apply   updates   in   the   change   log   back   to   the   database   by   calling   ApplyUpdates.)   A   newly   inserted   record   is   posted   in   one   of   three   ways:  
   
  For   Paradox   tables   with   primary   indexes,   the   record   is   inserted   into   the   dataset   in   a   position   based   on   its   index.  
  For   Paradox   tables   without   primary   indexes,   the   record   is   inserted   into   the   dataset   at   the   current   position.  
  For   dBASE,   FoxPro,   and   Access   tables,   the   record   is   physically   appended   to   the   dataset   at   the   end.   If   an   index   happens   to   be   active,   the   new   record   may   appear   in   a   position   relative   to   the   index,   but   the   record   is   still   actually   stored   at   the   end   of   the   table.  
   
  For   SQL   databases,   the   physical   location   of   the   insert   is   implementation-specific.   For   indexed   tables,   the   index   is   updated   with   the   new   record   information.Top

4 楼yingyys(鹰)回复于 2003-07-03 12:53:02 得分 10

设置索引吧Top

相关问题

  • Query执行INSERT的问题
  • 怎样在QUERY中使用INSERT语句啊?????
  • mysql中如何用mysql_query()一次执行多个insert语句?
  • 紧急求助,Query问题
  • insert into
  • Insert~~~~
  • insert
  • 关于Query->Filter的问题(急!急!急!急!急!急!急!急!急!)
  • 奇怪的INSERT问题,急!!!
  • 请教insert语句??(急...!!!)

关键词

  • record
  • inserted
  • 插入
  • 记录
  • dataset
  • position
  • posted
  • change
  • tables

得分解答快速导航

  • 帖主:bpaibgy
  • pazee
  • nanhui
  • yingyys

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo