Author Topic: Automation support for SQL-Repository  (Read 1852 times)

sr

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Automation support for SQL-Repository
« on: November 11, 2003, 07:48:58 am »
How can I access an SQL-Repository by the Automation Interface?

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 589
  • Karma: +7/-0
    • View Profile
Re: Automation support for SQL-Repository
« Reply #1 on: December 01, 2003, 04:15:18 pm »
Repository.Open( ) is the command for opening a repository in the Automation Interface .  The parameter for this can have a file path or an ODBC string as the parameter.  An example of this is attached below.

This can be further automated by calling your application from within EA and passing across a parameter in the call.  See: http://www.sparxsystems.com.au/AutIntVBCallingFromEA.htm
There is an example code using this type of call in:
http://www.sparxsystems.com.au/AutIntVBDownload.htm

I hope this of help.

Sub Main()
   Dim rep As EA.Repository
   Dim Package As EA.Package
 
   Dim aPackageGuid As String
   Dim aProject As EA.Project
   
   Set rep = New EA.Repository
  ODBC path ..
   rep.OpenFile "SQLREPOS ---
      DBType=1;Connect=Provider=MSDASQL.1; _
      Password=xxxxx;Persist Security _
      Info=True;User ID=xx;Data Source=xxxxx"
    File path
   'rep.OpenFile "C:\Program Files\Sparx" + _  
   "Systems\EA\EAExample.eap"
   
   Set Package = rep.Models.GetByName("Support")
   aPackageGuid = Package.PackageGUID
   
   Set aProject = rep.GetProjectInterface()
   aProject.RunHTMLReport aPackageGuid, "C:\temp", "BMP", "", "htm"
   
   rep.Exit
   Set rep = Nothing
   
End Sub
:)

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 589
  • Karma: +7/-0
    • View Profile
Re: Automation support for SQL-Repository
« Reply #2 on: December 01, 2003, 04:21:39 pm »
Just an update on that - use the ODBC string defined in EA when doing:
File | Open
Copy the text from the ODBC link in the field: Project to Open
Use this text as the ODBC string in Repositpory.OpenFile()
:)