关于“ADO类型”和“OLE DB类型”和“OLE DB类型”。 [英] About "ADO type" and "OLE DB type"

查看:124
本文介绍了关于“ADO类型”和“OLE DB类型”和“OLE DB类型”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我阅读"用于OLE DB的.NET Framework数据提供程序"部分时,我提出了一个好奇心。文章"将数据提供程序数据类型映射到.NET Framework数据类型"〜
http://msdn.microsoft.com/en-us/library/4e5xt97a(VS.80).aspx
因此,我会问问题以满足我的好奇心。问题是〜
"ADO类型"在哪里? (例如"adChapter")和"OLE DB类型"("OLE DB类型")。 (例如"DBTYPE_HCHAPTER")使用了什么?

我想"OLE DB类型"在SQL语句中使用(虽然我知道OLE DB连接器不支持所有类型的SQL语句...),例如〜

CREATE TABLE a_table(某些DBTYPE_HCHAPTER,...) - .. 。

我想"ADO类型"用于非SQL程序代码(我将在"草拟"中编写C#...),例如〜

switch(a_column.type){
case OleType.adChapter:
// ...
break;
默认:
// ...
break;
}

如果有人能回答我的问题,我会很高兴说明我的猜测是否正确。

I raised a curiosity when I read the section ".NET Framework Data Provider for OLE DB" of the article "Mapping Data Provider Data Types to .NET Framework Data Types"~
http://msdn.microsoft.com/en-us/library/4e5xt97a(VS.80).aspx
Therefore, I would to ask question for satisfying my curiosity. And the question is~
Where are the "ADO type" (e.g. "adChapter") and the "OLE DB type" (e.g. "DBTYPE_HCHAPTER") used?

I guess the "OLE DB type" is used in SQL statement (although I know that OLE DB connector does not support all types of SQL statement...), for example~

CREATE TABLE a_table (something DBTYPE_HCHAPTER, ...) --...

And I guess the "ADO type" is used in non-SQL program code (I will write in "drafted" C#...), for example~

switch (a_column.type){
case OleType.adChapter: 
    //...
break;
default: 
    //...
break;
}

I will be glad that if anyone can answer my question and state that whether my guess is correct.

推荐答案

使用ADO(而不是ADO.NET)命令连接时,在基于COM的代码中使用ADO类型来创建参数你的代码。 OLEDB类型是OLEDB提供者内部的内部类型。只有当您的代码直接使用OLEDB API而没有任何包装器 - ADO或ADO.NET或其他包装时,才使用它们。对于SQL语句,您需要使用SQL Server类型(如果您的SQL语句将在SQL Server环境中执行)。
ADO types was used in COM-based code when you connected using ADO (not ADO.NET) command to create parameters in your code. OLEDB types are internal types inside of OLEDB providers. You use them only if your code uses OLEDB API directly without any wrapper - ADO or ADO.NET or some other. For SQL statements you need to use SQL Server types (in a case if your SQL statement will be executed in SQL Server environment).


这篇关于关于“ADO类型”和“OLE DB类型”和“OLE DB类型”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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