讨论:DAO.DBEngine.Workspaces()与DAO.Workspaces() [英] Discussion: DAO.DBEngine.Workspaces() versus DAO.Workspaces()

查看:216
本文介绍了讨论:DAO.DBEngine.Workspaces()与DAO.Workspaces()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题或讨论点如果你愿意,为什么默认的Workspace对象总是被描述为 DBEngine.Workspaces(0)而不是更简单的工作区(0)根据我发现的所有内容,这是同一件事。我错过了重要的事吗?我甚至找不到确认引用是相同的引用,尽管它们都来自DAO库。


我正在寻找一种方法来确定处理Database对象时涉及的实际Workspace对象。我很惊讶DAO.Database对象没有一个简单的属性指向它所在的工作区,但它没有。我到目前为止最好的是:

展开 | 选择 | Wrap | 行号

解决方案

尽我所能知识,没有简单的方法来确定特定数据库引用的实际工作空间对象。您的解决方案看起来是一个很好的解决方出于好奇,你为什么需要确定指定数据库的工作空间对象?


ADezii:

出于好奇,为什么需要确定指定数据库的工作空间对象?



我正在编写执行应该作为单个事务运行的批量SQL命令的例程。事务以及与它们一起使用的方法是在Workspace级别工作的事情,因此,虽然必须在Database对象上执行SQL,但Transaction由相关的Workspace对象定义。因此,数据库都需要相关的Workspace对象。


http://msdn.microsoft.com/en-us/libr...ffice.12)。 aspx

列表下的第一段:


当您第一次引用或使用Workspace对象时,您会自动创建默认工作空间,DBEngine.Workspaces(0)。



这可能是更正确的问题。在工作区的描述中。


我只使用这个方法,总是使用完整的构造,就像我对DAO。*对象一样,确保对代码解析器没有误解 - 我只是不要相信开发人员不要使用一些新的或更改的库引用来解决问题。 :)


My question, or point of discussion if you like, is why is the default Workspace object always described as DBEngine.Workspaces(0) and not the simpler Workspaces(0) which, according to all I''ve discovered, is the same thing. Am I missing something important? I couldn''t even find a reference that confirmed that the references are the same, although they are both from the DAO library.

I''m looking for a way to determine the actual Workspace object involved when dealing with a Database object. I''m surprised the DAO.Database object doesn''t have a simple property pointing to the workspace it''s within, but it doesn''t. The best I have so far is :

Expand|Select|Wrap|Line Numbers

解决方案

To the best of my knowledge, there is no easy way to determine the actual Workspace Object referenced by a specific Database. Your workaround looks like a good solution. Just out of curiosity, why do you need to determine the Workspace Object for a specified DB?


ADezii:
Just out of curiosity, why do you need to determine the Workspace Object for a specified DB?

I''m writing routines that execute batches of SQL commands that should be run as a single transaction. Transactions, and the methods that go with them, are things that work at the Workspace level, so, while the SQL must be executed on the Database object, the Transaction is defined by the related Workspace object. As such, the Database and the related Workspace objects are both required.


http://msdn.microsoft.com/en-us/libr...ffice.12).aspx
First paragraph under the list:

When you first refer to or use a Workspace object, you automatically create the default workspace, DBEngine.Workspaces(0).

It maybe the matter of being "more correct" in the description of the workspace.

I for one, whenever using this method, have always used the full construct much like I do with the DAO.* objects to ensure that there is no misunderstanding the code parser - I simply do not trust the developers not to muck things up with some new or changed library reference. :)


这篇关于讨论:DAO.DBEngine.Workspaces()与DAO.Workspaces()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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