opps, let's try this again.  You said Access.
Sorry not sure where I got Excel from.  Anyways
here some Access examples:

Using Rose script to communicate with Access:

One can write a script (using Rose's scripting language) to
use OLE to move infomration between the two.

      Short Rose script example:

      Sub Main
              Dim Access_app As Object
              Set Access_app = CreateObject("Access.Application")
              Access_app.Visible = True
              Access_app.OpenCurrentDatabase "C:\Program Files\Microsoft
Office\samples\orders.mdb"
              Access_app.Visible = True
      End Sub

      Rose script is a VB compatible language (Summit Basic) along
      with the Rose objects (REI rose extensibility interface).
      The next step would be to access the database infomration via
      Access OLE interface and then convert that to Rose objects via
      the REI.     Unfortunetly I am unaware of any existing scripts
      to work with Access (except the one I copied below).

      As a starting point see sample script that ships with Rose,
      /Rose... /scripts/excel.ebs for an example script that uses OLE
      to write information to an excel spreadsheet.   Same principles
      apply to Access.   Only difference is the object's properties 
      and methods that are unique to each application.   You would need
      to refer to Microsoft documentation for the Access specific
      keywords.

      For information on   scripts in general see,
      OLE Automation: Communicating with Other Applications"
      http://www.microsoft.com/AccessDev/Articles/comothap.htm

-------------------------------------------------------------------

Code example posted to the Rose forum:

To: "'Rose Forum'" <[EMAIL PROTECTED]>

I wrote a script that accesses via OLE (actvieX) an MSAccess database.
Tables in tehh MSAccess database reflect the structure of the model.
Subroutines in the MSAccess database populate these tables with
information from the model.

Example:
The database is called "RoseModel.mdb" and contains a table "tblClasses"
that has columns psk, name, documentation and category. 
Also a module called "RationalRose_subs" is defined. Subroutines and
functions in this module will be accessed from from my Rational Rose
model (the .mdl file). I included some coding (see end of my reply)

The procedure is as follows:
*)The model is loaded into Rational Rose.
*)The "export model information" script is loaded into Rational Rose.
*)The script is runned and the tables in the MSAccess database are
populated.

This procedure is not as flexible as XML would be but it has the
advantage for that once I have the model information inn an MSAcces
adatabase I can generate reports that exactly reflect the information
that I require.

And this method has a few conditions that have to be met beforehand:
1. An MSacces database must exist that reflects the information that you
want to store from the model.
2. In the MSAccess database subroutines must exist that access the
tables in the database.
3. Last but not least, you need to have knowledge of MSAccess databases
and accessing tables via VBA.

Another thing to keep in mind is that there is a strong coupling between
the Rational Rose script and the database that is populated. 
The tricky thing is to set up an initial database, after that you gain
in efficiency because you can easily add extra columns to tables and
quickly generate custom made reports etc. so that specific information
can be obtained fast.

-----[ START OF CODE ]-----

Sub ExportModelInformation
              ...
              ...
              ...

              '
              ' Open the MSAcces database. Create it if necessary
              '
              Set msaApp = getobject (dbLocation &
dbName,"Access.application")
              Set msaDbs = msaApp.currentdb
' Open 
database
              msaApp.run "rroAddSession", sessionName, startofModule
              '
              ' Retrieve information from the model and
              ' populate tables in MSAccess database
              '
              Dim theCategoryCollection                 As
CategoryCollection
              Dim theCategory
As Category

              ' Open table "tblCategories"
              ' (rrOpentables is a sub in the MSACcess database)
              msaApp.run "rroOpentables", tblCategories

              ' Retrieve package information from the model 
              ' and populate table "tblCategories"
              ' (rroAddRecord is a sub in the MSAccess database)
              Set theCategoryCollection = theModel.GetAllCategories()
              For i=1 To theCategoryCollection.count
                              Set theCategory =
theCategoryCollection.GetAt(i)
                              msaApp.run "rroAddRecord", 
 
tblCategories,theCategory.name, 
theCategory.documentation
              next i
              ...
              ...
              ...

              ' Close database and finish application
              msaDbs.close
              msaApp.quit
              MsgBox "Dataloading finished"

End Sub

-----[ END OF CODE ]-----

-------------------------------------------------------------------


-----Original Message-----
From: Ronald W Townsen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 18, 2003 7:59 AM
To: [EMAIL PROTECTED]
Subject: (ROSE) Rose Scripting and MS Access97







Does anyone have some example Rose Scripting Code showing how to work with
Acess97?

Create/Update/Query?

************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
* Only plain-text messages are supported.
* HTML or Rich-Text messages may be rejected.
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
*    http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*    To: [EMAIL PROTECTED]
*    Subject: <BLANK>
*    Body: unsubscribe  rose_forum
*************************************************************************
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
* Only plain-text messages are supported.
* HTML or Rich-Text messages may be rejected.
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
*    http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*    To: [EMAIL PROTECTED]
*    Subject: <BLANK>
*    Body: unsubscribe  rose_forum
*************************************************************************

Reply via email to