Thank you, this article helped me understand MSCATALOG and MSLINK.
Before my above error message, which I only assume now that I didn't follow the steps to the letter in chapter 27 of the book (I`m thinking I didn't add a reference file!) anyway moving on, what I was trying to achieve was to select an element in microstation and create a database link in which I achieved by using the following code.
I finally found the Syntax highlighter tool in the advanced reply editor thanks for the tip!
also
My ustation version is 08.11.09.459
Sub DatabaseLinkA() Dim myElem As Element Dim myLink As DatabaseLink Set myElem = CommandState.GetLocatedElement(True) Set myLink = CreateDatabaseLink(1, 1, msdDatabaseLinkageOleDb, _ True, 0) myElem.AddDatabaseLink myLink myElem.Rewrite End Sub
I noticed in the code the fields for MSLINK=1 and Entity=1, shown below
Set myLink = CreateDatabaseLink(1, 1, msdDatabaseLinkageOleDb, _ True, 0)
If I wanted to add another link (in this case MSLINK=2) to an element, I found that by changing the code to
Set myLink = CreateDatabaseLink(2, 1, msdDatabaseLinkageOleDb, _ True, 0)
My question is how do I select and element and assign a different (unique) MSLINK to it, without having to change the code each time?