VBA访问数据类型

时间:2017-02-24 18:10:22

标签: vba access-vba type-conversion

是否可以使用

DoCmd.TransferText acImportDelim, acSpreadsheetTypeText, strFile, strPathFile, blnHasFieldNames

要将其中一列的数据类型更改为数字中的文本?使用VBA Access?

1 个答案:

答案 0 :(得分:0)

Sub AlterTableX1()

    Dim dbs As Database

    ' Modify this line to include the path to Northwind
    ' on your computer.
    Set dbs = OpenDatabase("Northwind.mdb")

    ' Add the Salary field to the Employees table 
    ' and make it a Money data type.
    dbs.Execute "ALTER TABLE Employees " _
        & "ADD COLUMN SomeNumber Number;"

    dbs.Close

End Sub

有关详细信息,请参阅此处。

MS Access SQL, changing data type