CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

如何为msdatagrid控件动态绑定数据源?

楼主fajili(阿良)2001-11-07 21:02:54 在 VC/MFC / 基础类 提问

问题点数:15、回复次数:12Top

1 楼wyzegg(蛋)回复于 2001-11-07 21:20:24 得分 5

使用一个ADODC和msdatagrid绑定  
  然后生成一个变量m_adodc  
  用m_adodc.SetConnectionString  
      m_adodc.SetReccordSource  
    m_sdodc.Refresh  
  就OK啦  
  Top

2 楼fajili(阿良)回复于 2001-11-07 21:23:06 得分 0

有谁知道,请告诉我,这里先谢谢了。Top

3 楼fajili(阿良)回复于 2001-11-07 21:27:41 得分 0

我生成m_adodc变量后,调试通过,但一run就出错。  
  我现在想知道不用ADODC如何绑定?Top

4 楼fajili(阿良)回复于 2001-11-07 21:56:43 得分 0

接上。出错具体情况如下:  
  用m_adodc变量移动记录时出现调试错误,我使用的语句为:  
  m_adodc.getrecordset().movelast()  
  如果不对,该如何移动记录呢?请指教。Top

5 楼jiangsheng(蒋晟.Net[MVP])回复于 2001-11-08 21:42:51 得分 0

move之前看看是否IsEOFTop

6 楼fajili(阿良)回复于 2001-11-08 22:00:01 得分 0

在第一条记录处开始执行也出现错误,应该不是这个原因。记录总数在一条以上。Top

7 楼jiangsheng(蒋晟.Net[MVP])回复于 2001-11-08 22:06:46 得分 10

http://download.microsoft.com/download/vc60pro/Utility/1.0/W9X/EN-US/Mfceqado.exe  
  SAMPLE:   Mfceqado.exe   Shows   How   to   Use   English   Query   with   MFC   and   ADO    
  ID:   Q229612    
   
   
  --------------------------------------------------------------------------------  
  The   information   in   this   article   applies   to:  
   
  Microsoft   Visual   C++,   32-bit   Editions,   version   6.0    
  Microsoft   English   Query,   version   7.0    
  ActiveX   Data   Objects   (ADO),   versions   2.1,   2.5  
   
  --------------------------------------------------------------------------------  
   
   
  SUMMARY  
  Mfceqado.exe   is   an   English   Query   ADO   Visual   C++   sample   that   uses   ADO   in   a   Visual   C++   MFC   application   to   query   SQL   Server   statements   generated   by   the   English   Query   engine.   The   sample   uses   DataGrid   Control   version   6.0   (OLEDB)   to   display   the   results.    
   
  Top

8 楼fajili(阿良)回复于 2001-11-08 22:39:13 得分 0

to   jiangsheng:  
  你的原码已下载,但编译出错,少库文件。  
  fatal   error   C1083:   Cannot   open   type   library   file:   'e:\Program   Files\Common   Files\System\EQ\mseqole.dll':   No   such   file   or   directoryTop

9 楼jiangsheng(蒋晟.Net[MVP])回复于 2001-11-08 22:43:34 得分 0

The   English   Query   code   used   in   this   sample   is   very   similar   to   the   MFCUI   C++   Remote   Data   Objects   (RDO)   English   Query   sample   that   ships   with   the   SQL   Server   7.0   CD-ROM.    
   
  Refer   to   the   following   Microsoft   Knowledge   Base   article   for   more   information   on   how   to   use   DataGrid   Control   with   ADO   in   Visual   C++:    
  Q229029   SAMPLE:   AdoDataGrid.exe   Demonstrates   Using   ADO   with   DataGrid    
  Steps   to   Run   Sample  
  Build   and   run   Mfcequi.exe.  
   
   
  Specify   an   English   Query   (EQ)   application   (.eqc)   file   and   a   question   (.eqq)   file   in   the   Welcome   dialog   box.   You   can   use   either   the   Pubs.eqc   or   NorthWind.eqc   sample   EQ   files   that   are   installed   by   EQ   in   the   samples   folder.  
   
   
  Click   Start   Application   in   the   Welcome   dialog   box.  
   
   
  Choose   a   SQL   Server   7.0   data   source   in   the   ODBC   Administrator   dialog   box   that   displays   when   you   click   Start   Application.  
   
   
  Enter   an   English   sentence   to   query   into   the   main   query   dialog   box.   For   example,   enter   the   following   query   for   the   pubs   database   if   you   select   Pubs.eqc   in   step   2:  
   
  How   many   authors   live   in   Oakland   ?  
   
   
  Click   Submit   to   run   the   query.   The   English   Query   parses   the   English   statment   to   generate   SQL   language.   The   application   uses   ADO   to   submit   the   SQL   statement   to   SQL   Server.   The   DataGrid   displays   the   results.   Click   Show   SQL   to   see   SQL   language   command   sent   to   SQL   Server.  
   
   
  Top

10 楼cft007(振翅欲飞)回复于 2001-12-11 22:13:41 得分 0

我使用msflexgrid控件绑定数据库的,原码你要不要????Top

11 楼woowindicevc(vcvc2vc)回复于 2001-12-11 22:29:00 得分 0

要!!!fcw2001@hzcnc.comTop

12 楼fajili(阿良)回复于 2001-12-11 22:31:26 得分 0

我要,先谢了!fjl1977@163.comTop

相关问题

  • 如何用DataGrid控件动态访问数据库
  • 如何动态创建数据窗口里的控件?
  • @@@@@@@@@@@@@@@@@@@@@如何动态配制adodc控件的数据源???please help me~~~~
  • 如何用database控件动态连接access数据库
  • 用DataGrid控件动态显示数据表问题
  • 如何动态控制数据模块中的ADO控件?
  • 关于动态控件数据的事件!!
  • 如何用动态控件连接数据库
  • datagrid动态绑定数据,怎么用label控件
  • 如何读取动态创建控件里的数据?

关键词

  • visual c++
  • ado
  • datagrid
  • visual
  • application
  • microsoft
  • sql
  • adodc
  • eqc
  • english

得分解答快速导航

  • 帖主:fajili
  • wyzegg
  • jiangsheng

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

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