在ADODB.Recordset上键入不匹配 [英] Type Mismatch on ADODB.Recordset

查看:65
本文介绍了在ADODB.Recordset上键入不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我正在调试以下几行代码,并得到一个类型不匹配13。 Set rs = line上的错误。


Dim rs As Recordset


设置rs = CreateObject(" ADODB.Recordset")


我正在运行MS-ACCESS 2000并添加了ADO库2.8。我也定义了我与网络的ODBC连接。


我做错了什么?


谢谢,

Gregg

Hello,

I am debugging the following lines of code and am getting a "type mismatch 13" error on the Set rs = line.

Dim rs As Recordset

Set rs = CreateObject("ADODB.Recordset")

I am running MS-ACCESS 2000 and have added ADO library 2.8. I also have defined my ODBC connection to the network.

What am I doing wrong?

Thanks,
Gregg

推荐答案

您必须定义数据库。
You have to define the database.
展开 | < span class =codeLinkonclick =selectAll(this);>选择 | Wrap | 行号



你好,


我正在调试以下几行代码并得到一个类型不匹配13 Set rs = line上的错误。


Dim rs As Recordset


设置rs = CreateObject(" ADODB.Recordset")


我正在运行MS-ACCESS 2000并添加了ADO库2.8。我也定义了我与网络的ODBC连接。


我做错了什么?


谢谢,

Gregg
Hello,

I am debugging the following lines of code and am getting a "type mismatch 13" error on the Set rs = line.

Dim rs As Recordset

Set rs = CreateObject("ADODB.Recordset")

I am running MS-ACCESS 2000 and have added ADO library 2.8. I also have defined my ODBC connection to the network.

What am I doing wrong?

Thanks,
Gregg



如果您检查了引用,为什么要创建对象?没有理由这样做,只需坚持使用新的。你也有DAO检查,并且还有一个Recordset属性,所以它总是最好指定哪一个


例如


dim rs as ADODB .Recordset


set rs = new ADODB.Recordset


for createobject,你通常会以这种方式使用它


dim rs as object


set rs = createobject(" ADODB.Recordset")




你好玛丽,好久不见了:)

你的问题:你不用currentdb for DAO吗?


来使用ado的当前数据库,你会用

currentproject.connection

例如


rs.Open" mysql" ;,currentproject.connection,adOpenStatic,adLockPessimistic

Why are you creating an object if u have the reference checked? There is no reason to do this, just stick with new. Also u have have DAO checked and that also has a Recordset property so its always best to specify which one

eg

dim rs as ADODB.Recordset

set rs = new ADODB.Recordset


for createobject, u would typically use it this way

dim rs as object

set rs=createobject("ADODB.Recordset")



Hi Mary, long time no see :)
question for you: dont u use currentdb for DAO?

to use the current database for ado, u would use
currentproject.connection

eg

rs.Open "mysql", currentproject.connection, adOpenStatic, adLockPessimistic



您好,


我正在调试下面的代码行,我得到一个类型不匹配13 Set rs = line上的错误。


Dim rs As Recordset


设置rs = CreateObject(" ADODB.Recordset")


我正在运行MS-ACCESS 2000并添加了ADO库2.8。我也定义了我与网络的ODBC连接。


我做错了什么?


谢谢,

Gregg
Hello,

I am debugging the following lines of code and am getting a "type mismatch 13" error on the Set rs = line.

Dim rs As Recordset

Set rs = CreateObject("ADODB.Recordset")

I am running MS-ACCESS 2000 and have added ADO library 2.8. I also have defined my ODBC connection to the network.

What am I doing wrong?

Thanks,
Gregg

正确的语法是:

The correct Syntax is:

展开 | 选择 | 换行 | 行号


这篇关于在ADODB.Recordset上键入不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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