ACCESS中的文本数据类型,对应VB的那种数据类型呀?
我有点白呵呵,其实是用ADOX根据ACCESS中的表来创建一个新表。。。。比如“姓名”我在ADOX中需要什么样的数据类型啊?...
我有点白呵呵,其实 是用ADOX根据ACCESS中的表来创建一个新表。。。。比如“姓名”我在ADOX中需要什么样的数据类型啊?
展开
2个回答
展开全部
String,
ADOX的数据类型是adVarWChar
给一个例程给你
Sub Create_Table()
Dim cat As ADOX.Catalog
Dim myTable As ADOX.Table
On Error GoTo ErrorHandler
Set cat = New Catalog
cat.ActiveConnection = CurrentProject.Connection
Set myTable = New Table
With myTable
.Name = "java2sTable"
With .Columns
.Append "Id", adVarWChar, 10
.Append "Description", adVarWChar, 255
.Append "Type", adInteger
End With
End With
cat.Tables.Append myTable
Set cat = Nothing
MsgBox "The new table 'java2sTable' was created."
Exit Sub
ErrorHandler:
If Err.Number = -2147217857 Then
cat.Tables.Delete "java2sTable"
Resume
End If
MsgBox Err.Number & ": " & Err.Description
End Sub
ADOX的数据类型是adVarWChar
给一个例程给你
Sub Create_Table()
Dim cat As ADOX.Catalog
Dim myTable As ADOX.Table
On Error GoTo ErrorHandler
Set cat = New Catalog
cat.ActiveConnection = CurrentProject.Connection
Set myTable = New Table
With myTable
.Name = "java2sTable"
With .Columns
.Append "Id", adVarWChar, 10
.Append "Description", adVarWChar, 255
.Append "Type", adInteger
End With
End With
cat.Tables.Append myTable
Set cat = Nothing
MsgBox "The new table 'java2sTable' was created."
Exit Sub
ErrorHandler:
If Err.Number = -2147217857 Then
cat.Tables.Delete "java2sTable"
Resume
End If
MsgBox Err.Number & ": " & Err.Description
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
vb中的也是文本吧
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询