帮助将DAO转换为ADO [英] Help with converting DAO to ADO

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

问题描述

我正在寻找在我的应用中将DAO转换为ADO。我所有的DAO连接

具有以下结构:


Dim wsName作为DAO.Workspace

Dim dbName作为DAO。数据库

Dim rsName作为DAO.Recordset


设置wsName = DBEngine.Workspaces(0)

设置dbName = wsName.OpenDatabase (CurrentProject.FullName)

设置rsName = dbName.OpenRecordset(SQL语句)


我是ADO的真正新手,不要''感觉很舒服。现在转换为ADO,如下所示:


Dim cnnName As New ADODB.Connection

Dim rsName As New ADODB。记录集


和这里我开始感到困惑:


设置cnnName = Application.CurrentProject.Connection ????

rsName.Open" SQL Statement" ????


因为我有几百个这样的DAO结构,如果我有办法写的话,我正试图想出

out代码来完成转换。


感谢您的帮助。


-

通过AccessMonster发布的消息。 com
http:/ /www.accessmonster.com/Uwe/For...ccess/200602/1

I''m looking at converting DAO to ADO in my app. All of my DAO connections
are of the following structure:

Dim wsName As DAO.Workspace
Dim dbName As DAO.Database
Dim rsName As DAO.Recordset

Set wsName = DBEngine.Workspaces(0)
Set dbName = wsName.OpenDatabase(CurrentProject.FullName)
Set rsName = dbName.OpenRecordset("SQL Statement")

I''m a real newbie with ADO and don''t feel at all comfortable with it. Now to
convert to ADO, something like:

Dim cnnName As New ADODB.Connection
Dim rsName As New ADODB.Recordset

and here''s where I start to get confused:

Set cnnName = Application.CurrentProject.Connection????
rsName.Open "SQL Statement" ????

Since I have several hundred of these DAO constructs, I''m trying to figure
out if there is a way I could write code to accomplish the conversion.

Thanks for any help.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200602/1

推荐答案

Robert,请问原因转换为ADO?


DAO是本机Access库。 DAO *中的A是* Access,它是访问本身在界面中使用的

库,那么为什么要更改

<微软大约在5年前推出ADO,作为一个更通用的库

(适用于比Access更宽的东西),但它现在已经死了,取而代之的是

非常不同的ADO.NET。因此现在没有必要这样做才能学习ADO,这对于Access应用程序来说完全没有意义,而且根本没有

点。为现有的Access应用程序执行此操作。


-

Allen Browne - Microsoft MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


" robert d通过AccessMonster。 COM" < u6836 @乌韦>在消息中写道

news:5bfe8a67536d4 @ uwe ...
Robert, can I ask the reason for converting to ADO?

DAO is the native Access library. The A in DAO *is* Access, and it is the
library Access itself uses in the interface, so why would you want to
change?

Microsoft was pushing ADO about 5 years ago, as a more generic library
(suitable for things wider than Access), but it is now dead, replaced by the
very different ADO.NET. There is therefore now no point in doing this just
to learn ADO, no point at all in doing it for an Access application, and no
point at all at all in doing it for an existing Access application.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"robert d via AccessMonster.com" <u6836@uwe> wrote in message
news:5bfe8a67536d4@uwe...
我正在寻找在我的应用程序中将DAO转换为ADO。我所有的DAO连接都具有以下结构:

Dim wsName作为DAO.Workspace
Dim dbName作为DAO.Database
Dim rsName作为DAO.Recordset

设置wsName = DBEngine.Workspaces(0)
设置dbName = wsName.OpenDatabase(CurrentProject.FullName)
设置rsName = dbName.OpenRecordset(" SQL Statement")

我是ADO的真正新手,对此感到不舒服。现在
转换为ADO,类似于:

Dim cnnName As New ADODB.Connection
Dim rsName As New ADODB.Recordset

>在这里我开始感到困惑:

设置cnnName = Application.CurrentProject.Connection ????
rsName.Open" SQL Statement" ????

由于我有几百个这样的DAO结构,我正试图想出是否有一种方法可以编写代码来完成转换。 />
感谢您的帮助。
I''m looking at converting DAO to ADO in my app. All of my DAO connections
are of the following structure:

Dim wsName As DAO.Workspace
Dim dbName As DAO.Database
Dim rsName As DAO.Recordset

Set wsName = DBEngine.Workspaces(0)
Set dbName = wsName.OpenDatabase(CurrentProject.FullName)
Set rsName = dbName.OpenRecordset("SQL Statement")

I''m a real newbie with ADO and don''t feel at all comfortable with it. Now
to
convert to ADO, something like:

Dim cnnName As New ADODB.Connection
Dim rsName As New ADODB.Recordset

and here''s where I start to get confused:

Set cnnName = Application.CurrentProject.Connection????
rsName.Open "SQL Statement" ????

Since I have several hundred of these DAO constructs, I''m trying to figure
out if there is a way I could write code to accomplish the conversion.

Thanks for any help.



Microsoft说:

* ADO:ActiveX数据对象(ADO)提供高级编程

模型,将继续得到增强。虽然比直接编写OLE DB或ODBC的性能要低一些,但ADO直接可以学习和使用,并且可以从脚本语言中使用

如Microsoft Visual Basic?脚本版(VBScript)或

Microsoft JScript?

Microsoft says:
* ADO: ActiveX Data Objects (ADO) provides a high-level programming
model that will continue to be enhanced. Although a little less
performant than coding to OLE DB or ODBC directly, ADO is
straightforward to learn and use, and can be used from script languages
such as Microsoft Visual Basic? Scripting Edition (VBScript) or
Microsoft JScript?.


Allen:


感谢您提供的信息。我还有一篇关于预期

客户的帖子,他担心我的应用程序是在玩具上开发的。数据库

,因为它是Access。他们希望我链接到SQL SERVER后端。在我的

其他帖子中,我已经要求论坛成员帮我证明Access的合理性,但是让'

不要在这里继续讨论。


我的数据库被拆分,所以一旦我们转换为SQL Server就不会有问题。使用

DAO我在测试中链接到另一台计算机上的SQL Server,并且数据检索的速度比链接到位于另一台计算机上的Jet DB更快。 />

到目前为止一切顺利。


但是,我正在努力预测这个潜在客户会接受什么
$ b $如果我不能说服他们我的前端是合适的话,那么我可以说服他们。


我想告诉他们我会把它转换成VB6。但我不确定

数据连接如何对SQL Server起作用。使用VB6我可以使用DAO来连接到SQL Server吗?


此外,如果我让他们相信我的应用程序会像

它目前是开发的,只是让有人问我是否通过DAO或ADO访问我的数据是否为
。我想如果我说DAO,它会适得其反。

点。


因此,我的问题。


顺便说一句:因为我已经开始反编译我的应用程序,稳定性显着提高了b $ b,尽管当我确实有腐败时它现在不同涉及

一些奇怪的错误信息,我永远无法解决。


谢谢。


Allen Browne写道:
Allen:

Thank you for the information. I have another post about a prospective
client who is concerned that my application was developed on a "toy" database
because it is Access. They want me to link to a SQL SERVER backend. In my
other post I have asked forum members to help me justify Access, but let''s
not continue that discussion here.

My DB is split so once we convert to SQL Server it won''t be a problem. With
DAO I have linked to SQL Server on another machine in a test and the data
retrieval is faster than in linking to a Jet DB located on another machine.

So far so good.

But, I''m trying to anticipate what this prospective client might accept as
alternatives if I can''t convince them that my front end is suitable.

I thought about telling them that I will convert it to VB6. But I''m not sure
how the data connections would work to SQL Server. With VB6 can I use DAO to
connect to SQL Server?

Also, what if I have them fairly convinced that my app will do the trick as
it currently is developed, only to have someone ask me if my data access is
via DAO or ADO. I think if I say DAO, it''ll be counterproductive at that
point.

Hence, my question.

BTW: Since I''ve started decompiling my app, the stability has improved
markedly, although when I do have corruption it is now different involving
some weird error message that I can never resolve.

Thanks.

Allen Browne wrote:
Robert,can我问转换为ADO的原因是什么?

DAO是本机Access库。 DAO *中的A是* Access,它是Access本身在界面中使用的库,所以为什么要改变?

微软正在推动ADO 5年前,作为一个更通用的库(适合比Access更广泛的东西),但它现在已经死了,取而代之的是非常不同的ADO.NET。因此,现在没有必要这样做才能学习ADO,完全没有必要为Access应用程序做这件事,而且在为现有的Access应用程序做这件事时根本没有任何意义。
Robert, can I ask the reason for converting to ADO?

DAO is the native Access library. The A in DAO *is* Access, and it is the
library Access itself uses in the interface, so why would you want to
change?

Microsoft was pushing ADO about 5 years ago, as a more generic library
(suitable for things wider than Access), but it is now dead, replaced by the
very different ADO.NET. There is therefore now no point in doing this just
to learn ADO, no point at all in doing it for an Access application, and no
point at all at all in doing it for an existing Access application.
我正在寻找在我的应用程序中将DAO转换为ADO。我所有的DAO连接都具有以下结构:
I''m looking at converting DAO to ADO in my app. All of my DAO connections
are of the following structure:


[引用文字剪辑 - 23行]


[quoted text clipped - 23 lines]


感谢您的帮助。

Thanks for any help.




-

通过AccessMonster.com发布消息
http://www.accessmonster.com/Uwe/For...ccess/200602/ 1


这篇关于帮助将DAO转换为ADO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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