Edit|Insert New Object

windowsicon


Use the Insert New Object command to insert an object or a link to an object into your model. As with the Edit|Paste Special command, this command is helpful in that it allows you to insert links to your model's data sources. Unlike the Paste Special command, which links to portions of an external object, the Insert New Object command can add a link to an entire object.

As an example, suppose you have the following staff scheduling model:

page119xp

From the model's data section, we see that we are using the @ODBC function to retrieve the values for the NEED attribute from an ODBC data source titled STAFFING. We are also using the @ODBC function to send the optimal values for the START attribute back to the same data source. Because this data source is an integral part of our model, it would be nice to place a link to it in our model, so we can retrieve it easily each time we want to refer to it. We can do this with the Edit|Insert New Object command as follows:

1.Position the cursor in the model where you would like the icon for the link to appear (Note, the LINGO parser ignores links to external objects, so you can insert the link anywhere you like.)
2.Issue the Edit|Insert New Object command. You should see the following dialog box:

fpage120axp

3.Select the Create from File radio button.
4.Type in the name of the database file containing your data.
5.Click the Display As Icon button, so the box now resembles:

page120bxp2

6.Finally, click on the OK button, and an icon representing the linked database will appear in your LINGO model as pictured below:

page121axp

Now, whenever you want to edit or view the supporting database, all you need do is double-click on the icon. In this case, Microsoft Access will start and load the staffing database, so you will see the following on the screen:

page121bxp2

As a final note, keep in mind that linked objects are preserved only when a model is saved in LG4 format (see the File|New command for details on the LG4 file format.)

For complete information on exchanging data and solution values with data sources, see Interfacing with Databases.