你的这行代码语法是没错的,你看看上下Me.Adodc1.Recordset.Fields(0).Name 的值是否为 null在立即窗口输入以下命令调试 ?Me.Adodc1 is nothing ? Me.Adodc1.recordset is nothing ? Me.Adodc1.recordset.eof ? Me.Adodc1.recordset.bof 只要有一个返回 true 就会出现 你的错误
to wbdx(碳离子): ?Me.Adodc1 is nothing False ? Me.Adodc1.recordset is nothing true ? Me.Adodc1.recordset.eof ? Me.Adodc1.recordset.bof 后面两个还没有出结果就报错了:对象变量或 With 块变量没有设置(错误 91)!为什么? ?Me.Adodc1 is nothing是干什么的?第二个应该为true呀!证明有连接数据库呀!?
錯,剛好証明沒有聯上 is nothing 阿!!1
Me.Adodc1.recordset is nothing true 证明你的数据连接有问题,没有得到recordset 对象?Me.Adodc1 is nothing 察看的你的 adodc1是否装入 false表示装入
?Me.Adodc1 is nothing
? Me.Adodc1.recordset is nothing
? Me.Adodc1.recordset.eof
? Me.Adodc1.recordset.bof
只要有一个返回 true 就会出现 你的错误
?Me.Adodc1 is nothing False
? Me.Adodc1.recordset is nothing true
? Me.Adodc1.recordset.eof
? Me.Adodc1.recordset.bof
后面两个还没有出结果就报错了:对象变量或 With 块变量没有设置(错误 91)!为什么?
?Me.Adodc1 is nothing是干什么的?第二个应该为true呀!证明有连接数据库呀!?
is nothing 阿!!1
证明你的数据连接有问题,没有得到recordset 对象?Me.Adodc1 is nothing
察看的你的 adodc1是否装入 false表示装入
我也试了一下全改为文本类型,可是问题依旧!
数据库是没有问题的,但是对adodc进行操作时,要用到datagrid之类的,具体操作如下:
在界面上添加一个datagrid1,datagrid1.datasouce设为adodc1
然后进行
Me.Combo1.AddItem Me.Adodc1.Recordset.Fields(0).Name
就没有问题了
顺便问一下,如果我不用adodc而用data的话,是不是就不需要那样?
只好将datagrid隐藏拉
我明明把分数给了你,但是我只有点击管理才看得到,平常的打开竟然是没有给你分,不知你那怎么样?如果你没有得到我给得分,在这留言告诉我!我再给你!