使用DAO检索C#中的访问数据 [英] using DAO to retrieve access data in C#

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

问题描述


有谁知道如何使用DAO从Access MDB文件中检索数据?
请帮忙.
我需要哪些引用,dll?
我找不到任何例子.

Hi,
Does anyone know how to retrieve the data from Access MDB file using DAO?
Please help.
What references, dll''s do I need?
I can''t find any examples.
Thanks.

推荐答案

在VS 2010中,打开解决方案资源管理器"> 参考"> 添加参考" ".Net",您可以看到组件"dao",并将其添加到引用中.

现在,您可以在项目中使用DAO.见下文:

内部静态dao.Database DAODataBase;
私有dao.Workspace DAOWorkSpace;
私有dao.DBEngine DAODBEngine = new dao.DBEngineClass();
DAODataBase = DAOWorkSpace.OpenDatabase("C:\\ MyData.mdb",null,null,; pwd =");
内部静态dao.Recordset DAOFoundCode;

Dao比OleDB快.我用140〜200毫秒从350000行数据中检索了20000行数据,但是OleDB需要500毫秒来填充DataSet.


Iao
In VS 2010, open the "Solution Explorer" > "Reference" > "Add Reference" > ".Net", you can see the component "dao", add it to reference.

Now you can use DAO in your project. See below:

internal static dao.Database DAODataBase;
private dao.Workspace DAOWorkSpace;
private dao.DBEngine DAODBEngine = new dao.DBEngineClass();
DAODataBase = DAOWorkSpace.OpenDatabase("C:\\MyData.mdb", null, null, ";pwd=");
internal static dao.Recordset DAOFoundCode;

Dao is faster than OleDB. I retrieve 20000 row data from 350000 row data with 140 ~ 200 ms, but OleDB needs 500 ms to fill DataSet.


Iao


DAO确实是一种旧的数据访问机制.跳过它,然后开始使用 OLE DB [ ^ ]
DAO is really an old data access mechanism. Skip it, and start using OLE DB[^]


为什么? DAO在十多年前就已弃用.

您找不到任何示例是有原因的.没有人使用它了!
Why? DAO was deprecated well over a decade ago.

There''s a reason you can''t find any examples. Noone uses it anymore!


这篇关于使用DAO检索C#中的访问数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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