Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA: Retrieve AutoDesk Map data source

Status
Not open for further replies.

jluost1

Programmer
Jun 8, 2001
78
US
I am using Autodesk Map 2005 and I opened a dwg file and attached an Access database (C:\temp\abc.mdb) through the menu Map->Data Source -> Configure.

Now I want to retrieve the data source (C:\temp\abc.mdb) via VBA code, but I don't know how.

I have looked at Database object and ModelSpace object; but none of them has data source property that I can use to retrieve the source of data.

Any idea?

Thank you.
 
Hi jloust1,

Since you are using VBA, the first thing you'll need to do in the VBA editor from the pull down menus Tools->References... is add a reference to Microsoft ActiveX Data Objects 2.x Library where x is 0 through 8. Select any which one of these you have listed - if you have multiples, I suggest selecting the latest and greatest in your list.

Then, you'll just talk to the database using the normal connection strings, and queries.

HTH
Todd
 
Thanks, but I am asking how to get the source of data (like c:\temp\test.mdb). Once I got the data source, I know how to build connection string and so on.

Any thoughts?
 
Hi jloust1,

Oops, sorry, I misunderstood - did you try adding a reference to CAO 1.0 Type Library? (The 1.0 may be different on your machine.) I've never used the CAO object model so I would be of much help but it may offer some help, if not, I'm Architectural Desktop user and there are many AEC references I can add - I'm sure map has it's own set as well?

HTH
Todd
 
I didn't add CAO 1.0 Type Library.

Let me give it a try. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top