与Access相关的问题 [英] Problem in connection with Access

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

问题描述

我使用下面提到的代码将vb6与ms access连接起来
但是当我运行项目时,它会显示编译错误(未定义用户定义类型)并突出显示此行(Conn As ADODB.Connection)
请解决这个问题


全局连接为ADODB.Connection
全局rs As ADODB.Recordset

子Access_Connector()
设置Conn = New ADODB.Connection
Conn.Provider ="microsoft.jet.oledb.4.0"
Conn.CursorLocation = adUseClient
Conn.Open App.Path和"\ SIS.mdb"
结束Sub

I use the below mentioned code for Connecting vb6 with ms access
but when i run the project it displays the Compile error which is( User Defined type not defined) and highlight this line ( Conn As ADODB.Connection )
Pls solve this problem


Global Conn As ADODB.Connection
Global rs As ADODB.Recordset

Sub Access_Connector()
Set Conn = New ADODB.Connection
Conn.Provider = "microsoft.jet.oledb.4.0"
Conn.CursorLocation = adUseClient
Conn.Open App.Path & "\SIS.mdb"
End Sub

推荐答案

您需要添加ADODB的引用.请参阅本教程,清楚地解释所有内容.

Visual Basic 6& ADO教程 [^ ]
You need to add the reference for ADODB. See this tutorial, explained all things clearly.

Visual Basic 6 & ADO Tutorial[^]


这篇关于与Access相关的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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