ADO 数据类型转换表

ADO 数据类型转换表

http://www.able-consulting.com/ADODataTypeEnum.htm

The following table shows the ADO Data Type mapping between Visual Basic, Access, SQL Server, Oracle, and the .NET Framework.

View printable version

ADO
DataType
Enum
ADO
DataType
Enum
Value
.NET
Framework
SQL
Server
SizeAccessOracleVisual
Basic
6.0
adBigInt20Int64
SqlDbType.BigInt 10
OleDbType.BigInt
11
bigint 98  Variant
adBinary128Byte[]
SqlDbType.VarBinary 10
OleDbType.Binary
11
binary
timestamp
50
8
 Raw 7 Variant
adBoolean11Boolean
SqlDbType.Bit 10
OleDbType.Boolean
11
bit
1
2
 
 
YesNo
 Boolean
adBSTR8String
OleDbType.BSTR
11
     
adChapter136(DataReader)     
adChar129String 
SqlDbType.Char 10
OleDbType.Char
11
charX CharString
adCurrency6Decimal
SqlDbType.Money 10
OleDbType.Currency
11
money
smallmoney
 
8
4
0
 
 
Currency
 Currency
adDate7DateTime
OleDbType.DBDate
11
 
0
 
DateTime
2
 Date
adDBDate133DateTime
OleDbType.DBDate
11
     
adDBFileTime137DBFileTime 11     
adDBTime134DateTime
OleDbType.DBTime
11
     
adDBTimeStamp135DateTime
SqlDbType.DateTime 10
OleDbType.DBTimeStamp
11
datetime
 smalldatetime
 
8
4
0
 
 
DateTime
1
DateDate
adDecimal14Decimal
OleDbType.Decimal
11
   Decimal 7 Variant 6
adDouble5Double
SqlDbType.Float 10
OleDbType.Double
11
float 
8
0
 
 
Double
FloatDouble
adEmpty0Empty 11     
adError10External-Exception
OleDbType.Error
11
     
adFileTime64DateTime
OleDbType.Filetime
11
     
adGUID72Guid 
SqlDbType.UniqueIdentifier 10
OleDbType.Guid
11
uniqueidentifier516 
 
ReplicationID
2,3 
 Variant
adIDispatch9Object
OleDbType.IDispatch
11
     
adInteger3Int32
SqlDbType.Int 10
OleDbType.Integer
11

identity 4
int
 

4
4
 
 
AutoNumber
Long Integer
Int 7 Long
adIUnknown13Object
OleDbType.IUnknown
11
     
adLongVarBinary205Byte[]
SqlDbType.VarBinary 10
OleDbType.LongVarBinary
11
image2147483647 
 
OLEObject
Long Raw 7
Blob
8
Variant
adLongVarChar201String
SqlDbType.VarChar 10
OleDbType.LongVarChar
11
text2147483647 
Memo 1, 2
Hyperlink
1, 2
Long 7
Clob
8
String
adLongVarWChar203String
SqlDbType.NText 10
OleDbType.VarWChar
11
ntext 51073741823 
Memo 3
Hyperlink
3
NClob 8String
adNumeric131Decimal
SqlDbType.Decimal 10
OleDbType.Decimal
11
decimal
numeric
 
9
 
 
 
Decimal
3
Decimal
Integer
Number
SmallInt
Variant 6
adPropVariant138Object
OleDbType.PropVariant
11
     
adSingle4Single
SqlDbType.Real 10
OleDbType.Single
11
real4 
 
Single
 Single
adSmallInt2Int16,
SqlDbType.SmallInt 10
OleDbType.SmallInt
11
smallInt2 
 
Integer
 Integer
adTinyInt16Byte
OleDbType.TinyInt
11
     
adUnsignedBigInt21UInt64
OleDbType.UnsignedBigInt
11
     
adUnsignedInt19UInt32
OleDbType.UnsignedInt
11
     
adUnsignedSmallInt18UInt16
OleDbType.UnsignedSmallInt
11
     
adUnsignedTinyInt17Byte
SqlDbType.TinyInt 10
OleDbType.UnsignedTinyInt
11
tinyInt1 
 
Byte
 Byte
adUserDefined132      
adVarBinary204Byte[] 
SqlDbType.VarBinary 10
OleDbType.VarBinary
11
varbinary50 
 
ReplicationID
1
 Variant
adVarChar200String
SqlDbType.VarChar 10
OleDbType.VarChar
11
varcharX 
 
Text
1, 2
VarCharString
adVariant12Object
SqlDbType.Variant 10
OleDbType.Variant
11
sql_variant 98016 VarChar2Variant
adVarNumeric139OleDbType.VarNumeric 11     
adVarWChar202String
SqlDbType.NVarChar 10
OleDbType.VarWChar
11
nvarchar 5X 
 
Text
3
NVarChar2String
adWChar130String
SqlDbType.NChar 10
OleDbType.WChar
11
nchar 5X  String

Top of Page

1 - ODBC Driver (3.51.171300):  Microsoft Access Driver (*.mdb),    Access 97 (3.5 format) 
2 - OLE DB Provider: Microsoft.Jet.OLEDB.3.51,   Access 97 (3.5 format)  
3 - OLE DB Provider: Microsoft.Jet.OLEDB.4.0 ,   Access 2000 (4.0 format) 
4 - OLE DB Provider: SQLOLEDB,   SQL Server 6.5 
5 - OLE DB Provider: SQLOLEDB,   SQL Server 7.0 +
6 - The VB Decimal data type can only be used within a Variant, that is, you cannot declare
     a VB variable to be of type Decimal. 
7 - Oracle 8.0.x   Note: DECIMAL and INT are synonyms for NUMBER and NUMBER(10) respectively.
8 - Oracle 8.1.x 
9 - OLE DB Provider: SQLOLEDB, SQL Server 2000 +
10 - SQL Server .NET Data Provider (via System.Data.SqlTypes)
11 - OLE DB .NET Data Provider (via System.Data.OleDb)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值