Writing Values to the Database File

Another essential operation is the ability to perform writing data to a table within the database file. The following example iterates through the Layers collection object and writes each layer's name and color value to the Layers table:

Dim oLayer As AcadLayer oRecordset.Open "Select * From Layers", oAccess, adOpenKeyset, adLockOptimistic

For Each oLayer In ThisDrawing.Layers With oRecordset .AddNew

!LayerName = oLayer.Name !Color = oLayer.Color .Update End With Next oLayer oRecordset.Close

+1 0

Post a comment