Database VBA application?

Database VBA application?

Anonymous
Not applicable
279 Views
1 Reply
Message 1 of 2

Database VBA application?

Anonymous
Not applicable
Hi every body, I seek good ideas for an application which I develop : - i have a window displaying a group of records from a ms access database - I want to link a record that I choose (or a group of of records ) with an object (or several autocad objects) - I want to create a data base of project which filled of the recordings linked to the autocad objects. - my data base of project would be filled by recordings related to objects of VARIOUS DWG files. - if in autocad, I make a copy of a cad object linked, automatically there would be a new addition record in my date base of project and if I remove it, of course, it would be removed from the data base of the project - it should be also also possible that i can select an autocad object, just by selecting the associated record (linked) and vice versa. If you have any idea helping me (i don't want use dbconnect), I appreciate very well thank you
0 Likes
280 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
You will need a value in the drawing and a value in a database table field that are equal so you can relate the two items. Often, an entity handle is used for this purpose. It works well for a one-to-one correspondence between a single drawing part and a single table record. Or, you can assign some value of your choosing, like a library part ID, to an attribute or Extended Entity Data (XData) of a drawing part. This is more suitable for relating parts used in many drawings to supplemental information in a database. You might even be able to do something with a drawing dictionary and XRecords. You can use MS ActiveX Data Objects (ADO) to connect the AutoCAD VBA code to the database. When the drawing opens, you will create an ADO recordset containing records from your database table(s). To automatically add/delete in the recordset when you add/delete in the drawing, you will probably want to enable application level events. In the BeginCommand or EndCommand event, check for a command that adds or deletes drawing parts. If one occurs, modify the recordset accordingly. When you are done with the drawing, maybe in the BeginSave or EndSave event, write the recordset back to the physical database table(s). That's it in a nutshell. Be advised that this type of project is a significant undertaking. You can start by studying the ADO Object Model in the Access online help. -- John Goodfellow irtfnm use john at goodfellowassoc dot com "media" wrote in message news:41894038$1_2@newsprd01... > Hi every body, > I seek good ideas for an application which I develop : > - i have a window displaying a group of records from a ms access database > > - I want to link a record that I choose (or a group of of records ) > with an object (or several autocad objects) > > - I want to create a data base of project which filled of the > recordings linked to the autocad objects. > > - my data base of project would be filled by recordings related to > objects of VARIOUS DWG files. > > - if in autocad, I make a copy of a cad object linked, automatically > there would be a new addition record in my date base of project and if I > remove it, of course, it would be removed from the data base of the project > > - it should be also also possible that i can select an autocad object, > just by selecting the associated record (linked) and vice versa. > > If you have any idea helping me (i don't want use dbconnect), I > appreciate very well > thank you >
0 Likes