需要帮助来解决使用DBList的问题 [英] Need help to solve the problem in using DBList

查看:104
本文介绍了需要帮助来解决使用DBList的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请解决我的问题

我在项目中使用DBList,但运行程序时,DBList中没有任何内容,代码如下:

Please solve my problem

I use DBList in my project but it shows nothing in the DBList at when i run the program the code is below:

'Code in view command

Private Sub cmdview_Click()

Set reccity = New ADODB.Recordset

reccity.Open "select * from city_detail where State_name='" & dc1.text & "'",Con,adOpenStatic,adLockOptimistic,adCmdText

Set dll.RowSource = reccity

dll.ListField = "City_Name"

dll.BoundColumn = "ID"

End Sub

'code in DBlist

Private Sub dll_Click()

reccity.Bookmark = dll.SelectedItem

txtid.Text = reccity.Fields(0)

dc1.Text = reccity.Fields(1)

txtcitynm.Text = reccity.Fields(2)

txtcitynm.Locked = False

End Sub



当我单击查看按钮后,它显示以下错误;



And after when i click on view button it shows the following error;

Error :  Run-Time error '91':

Object Variable or With block variable not set

推荐答案

I怀疑con是否以某种方式设置.调试更多.
I doubt con is not set somehow. Debug more.


这篇关于需要帮助来解决使用DBList的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆