If you're using Object Data then you must be using AutoCAD Map - and Map will do this automatically.
If you want to write your own custom app - then look at the samples folder for Database Connectivity and the Map Samples. Here you will find individual samples of using CAO and Map's Object Data Tables.
Scott