Skip to content

Commit

Permalink
add function to add binary column to an Access table
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoulJacobs committed Jun 30, 2022
1 parent 91cd903 commit 1105bc2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions M_omLibraryFunctions.def
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,23 @@ Dim F As AccessObject
rs.Close
Set rs = Nothing
End Sub

Public Sub CreateBinaryColumns()

Dim td As DAO.TableDef
Dim db As DAO.Database
Dim fd As Field

Set db = CurrentDb
Set td = db.TableDefs("Table1")

Set fd = td.CreateField("BinaryColumn", DataTypeEnum.dbBinary, 100)
fd.Attributes = fd.Attributes Or dbFixedField
td.Fields.Append fd

Set fd = td.CreateField("VarbinaryColumn", DataTypeEnum.dbBinary, 100)
td.Fields.Append fd

td.Fields.Refresh
db.TableDefs.Refresh
End Sub

0 comments on commit 1105bc2

Please sign in to comment.