关于VSFlexGrid绑定有出现空行的问题!
2007-07-05 16:32
267 查看
最近使用VSFlexGrid绑到DataSource为一个Oracle的Recoreset时,出现绑定的表格出现空间,有的时几行之间间断一行,有的是大片的间断.在Baidu和Google搜索了半天,也有些人和我遇到的是一样的问题,有的说Set Grid.DataSource=Rst后不关闭RecoredSet,认为是可能是还没有绑定完毕就关闭了Recordset造成的空行.这个我认为肯定是错误的,因为在一个线程里肯定不会出现这种情况的.还有的人是使用的是Unicode版的控件解决的问题.
诸如此类,我都试验了,但是都没有成功.
我将Recordset绑定到微软的MSHFlexGrid上居然没有问题,这说明我的Recordset得到的结果是肯定没有问题的,但是在使用方法上又没有错误.对于VsFlexGrid,我从7.0用到8.0,一直没有什么太大的问题,我想应该会有某种方法能够使用这种方式.于是,我首先尝试修改了Recordset的Cursortype,4个都试验了,不成功!于是我又试验了Connection的CursorLocation,将以前的客户端游标改为服务器端游标,测试,成功!!!!!
刚忙完,顺便去官方的网站上找了找,发现了有个帖子提供了解决的办法:
got interested in your problem (we use the grid in important products, so
any bug can hit us painfully).
I think I found the reason for those empty rows: the last field in all of
them contains a date value that ADO (at least in VB) apparently cannot
digest: '0001-01-01'. If you look it up directly in the recordset, accessing
the field value yields in error
"Multi-step operation generated errors. Check each step ..."
The other field values can be accessed normally, but obviously the grid
discards the whole row content, keeping the added row as empty. After the
first error there is some strange thing happening: some of the correct row
contents do get displayed if yo scroll down far enough and then back.
I seem to remember that the lowest date value handled by ADO or VB is
something like 0100-01-01, but could not locate the reference. (The
restriction might be connected with the handling of 2-digit year format
items.)
现在就清楚了,对于我的问题来说,原来是Oracle的日期"非法",使用to_char(date,'yyyy-mm-dd')转换化,问题解决.
写此文章,希望对还在使用VB6这个老玩具,且使用VsFlexgrid的人有点帮助吧..
诸如此类,我都试验了,但是都没有成功.
我将Recordset绑定到微软的MSHFlexGrid上居然没有问题,这说明我的Recordset得到的结果是肯定没有问题的,但是在使用方法上又没有错误.对于VsFlexGrid,我从7.0用到8.0,一直没有什么太大的问题,我想应该会有某种方法能够使用这种方式.于是,我首先尝试修改了Recordset的Cursortype,4个都试验了,不成功!于是我又试验了Connection的CursorLocation,将以前的客户端游标改为服务器端游标,测试,成功!!!!!
刚忙完,顺便去官方的网站上找了找,发现了有个帖子提供了解决的办法:
got interested in your problem (we use the grid in important products, so
any bug can hit us painfully).
I think I found the reason for those empty rows: the last field in all of
them contains a date value that ADO (at least in VB) apparently cannot
digest: '0001-01-01'. If you look it up directly in the recordset, accessing
the field value yields in error
"Multi-step operation generated errors. Check each step ..."
The other field values can be accessed normally, but obviously the grid
discards the whole row content, keeping the added row as empty. After the
first error there is some strange thing happening: some of the correct row
contents do get displayed if yo scroll down far enough and then back.
I seem to remember that the lowest date value handled by ADO or VB is
something like 0100-01-01, but could not locate the reference. (The
restriction might be connected with the handling of 2-digit year format
items.)
现在就清楚了,对于我的问题来说,原来是Oracle的日期"非法",使用to_char(date,'yyyy-mm-dd')转换化,问题解决.
写此文章,希望对还在使用VB6这个老玩具,且使用VsFlexgrid的人有点帮助吧..
相关文章推荐
- 关于VSS和Visual Studio代码上传出现空行问题的解决
- 关于shtml页面include问题解决方案因为utf-8的BOM头引起的出现一个空行
- 关于使用Eclipse编辑Android程序出现R文件消失的问题
- 关于数组的问题(连续子数组的最大和、数组中出现次数超过一半的数字、调整数组顺序使奇数位于偶数之前)
- 关于eclipse下web应用连接mysql数据库出现找不到驱动包的问题
- 关于顺达客户最近出现的问题
- 关于启动Linux时出现Error $15的问题
- 关于jacob中出现的问题(上传文件)
- 关于百度地图定位中出现4.9E -324定位问题的解决
- 关于安装.NET Framework 2.0时偶然碰到的问题(提示"Error 205015. 安装程序集..../System.EnterpriseServices.dll失败,原因是出现了系统错误:拒绝访问。")
- 关于内核模块挂载出现“no symbol version for”问题的研究
- 关于学习 spring-security 5.0.2 出现的问题
- 关于VS2013 MFC单文档菜单项设置复选框的出现的问题以及处理方法
- 关于使用FCKedioor中出现的问题
- 关于SQL安装时出现的有程序安装挂起问题的解决方法
- 关于MySQL链接出现的问题
- 关于OGRE配置CEGUI系统出现的问题
- 关于编译x264时出现的for Cortex-A8 erratum because it has no mapping symbols问题
- 关于alert()中出现中文乱码问题
- 关于PC套件显示红外连接出现问题而导致连接不上的解决方案(zz)