高手请进,关于ComctilLib的问题

meteor_liang 2001-10-02 12:52:38
那位高手知道ComctilLib是什么东西?或告诉我哪里有他的资料!
...全文
327 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
meteor_liang 2001-10-08
  • 打赏
  • 举报
回复
up
0aaron 2001-10-07
  • 打赏
  • 举报
回复
up
meteor_liang 2001-10-03
  • 打赏
  • 举报
回复
up
meteor_liang 2001-10-03
  • 打赏
  • 举报
回复
to bucher:
我没有对Microsoft Common Controls 5.0的引用,我一直只引用引用Microsoft Common Controls 6.0,我已试过改为Private Sub listStudents_ItemClick(ByVal Item As ListItem)。结果还是一样。后来,在access 2000数据库中我把学号这个属性的类型由整数改为
改为文本,就好了!

to karma:
我的qq:1306890.我还有问题问你,望指教!
meteor_liang 2001-10-02
  • 打赏
  • 举报
回复
怎么没有高手出手相助呢?

难道又要劳动acptvb的大驾吗?
meteor_liang 2001-10-02
  • 打赏
  • 举报
回复
对不起,我用的是access 2000.没有QUERY ANALYZER

当然,之前半个月,我是用sql server 7.0,好像也出同样的问题,我先回去用QUERY ANALYZER

测试一下 我那个sql server 7.0的程序,谢谢你的帮忙!现在我要下了,晚上再来!
karma 2001-10-02
  • 打赏
  • 举报
回复
看不出什么错来,你的语句,譬如
"select * from student where 学号= '121'"
在QUERY ANALYZER下运行没问题么?
meteor_liang 2001-10-02
  • 打赏
  • 举报
回复
to karma :
我热切等待你的回答!
meteor_liang 2001-10-02
  • 打赏
  • 举报
回复
由于这个网页的显示问题,rs.open"..."我是分两行的,他却显示在一行上,所以,你看起来多
_,不要以为是我的拼写错误导致出错!
meteor_liang 2001-10-02
  • 打赏
  • 举报
回复
to karma:

对,我在对象浏览器里,能找到comctlLib 也叫MSComCtlLib.
但是,我早就添加了Microsoft Windows Common Controls 6.0了。因为我一直在用listview作为数据库浏览窗口的。可我就是找不到他。在程序中用到他时就显示出错。奇怪!

我给你源码吧!
Private Sub listStudents_ItemClick(ByVal Item As ComctlLib.ListItem)
Dim rs As Recordset
Set rs = New Recordset

If mbNeedSave Then
If Not UpdateRecord() Then
Set listStudents.SelectedItem = listStudents.ListItems(msCurrentRecord)
Exit Sub
End If

End If

Set rs = New Recordset
rs.Open "select * from student where 学号= '"_ +Item.Key+ "'" ,mConn,adOpenForwardOnly, adLockReadOnly

Do Until rs.EOF
Item.Text = rs("学号")
Item.SubItems(1) = rs("姓名")
Item.SubItems(2) = rs("入学时间")
Item.SubItems(3) = rs("届数")
Item.SubItems(4) = rs("已付学费")
Item.SubItems(5) = rs("未交学费")
Item.SubItems(6) = rs("学生类型")

txtNumber.Text = rs("学号")
txtName.Text = rs("姓名")
txtInTime.Text = rs("入学时间")
txtInNumber.Text = rs("届数")
txtInFee.Text = rs("已付学费")
txtOffFee.Text = rs("未交学费")
txtType.Text = rs("学生类型")

rs.MoveNext
Loop

rs.Close
Set rs = Nothing
mbNeedSave = False
cmdUpdate.Enabled = False
cmdDelete.Enabled = True

msCurrentRecord = txtNumber.Text

End Sub

他总显示rs.open"...."出错!
karma 2001-10-02
  • 打赏
  • 举报
回复
it is ComctlLib Or MSComCtlLib

in VB, Project->Components, find Microsoft Windows Common Controls 6.0 (if you do not see it, browser to System directory, find MSCOMCTL.OCX), select it, you will a few entries (like listcontrol, tree control, image control, etc.) are added to your toolbox
meteor_liang 2001-10-02
  • 打赏
  • 举报
回复
难道就没有高手吗?
bucher 2001-10-02
  • 打赏
  • 举报
回复
去掉对Microsoft Common Controls 5.0的引用,改为引用Microsoft Common Controls 6.0。然后修改你的方法为Private Sub listStudents_ItemClick(ByVal Item As ListItem)即可。
meteor_liang 2001-10-02
  • 打赏
  • 举报
回复
to ozw:
拼写肯定没有错误·
to karma:
但是,我找不到他的资料,在vb里面用到他时,要做什么引用或部件添加吗?
要不,我把源代码给你看看!急切等待你的回复!
karma 2001-10-02
  • 打赏
  • 举报
回复
how did you fill the list? did you set the key for the listitem?
meteor_liang 2001-10-02
  • 打赏
  • 举报
回复
up
ozw 2001-10-02
  • 打赏
  • 举报
回复
可能拼写错了,搜索引擎什么都没找到!
ozw 2001-10-02
  • 打赏
  • 举报
回复
没见过,不过既然有这么个东西,为何不上搜索引擎查一下呢?
meteor_liang 2001-10-02
  • 打赏
  • 举报
回复
我回去试过,只要把Private Sub listStudents_ItemClick(ByVal Item As ComctlLib.ListItem)

改为Private Sub listStudents_ItemClick(ByVal Item As MSComctlLib.ListItem)
经过测试,可以肯定MSComctlLib.ListItem,是对的,ComctlLib.ListItem是错的.
然后,把rs.Open "select * from student where 学号= '"+Item.Key+ "'" ,mConn,adOpenForwardOnly, adLockReadOnly

的'"+Item.key+"'改为学号的一个实际值例如99061224的话,就没有错误,我估计是Item.key
的引用是错的.望高手指教!
karma 2001-10-02
  • 打赏
  • 举报
回复
it is a common controls library, like listview, treeview controls, etc.

7,762

社区成员

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

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