Author Topic: Connect an external database and create elemenets based on queries  (Read 4364 times)

Anatoly

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Hi All!

I am searching for a right approach to the following problem. I've got a database with lots of objects stored in it along with the object meta-model.

I'd like to be able to query the database from a EA project and create Class elements based on the meta-model.

I tried to create ADODB.Connection objects in a VBScript. I also tried to connect to a web-server through a XMLHTTP objects. No luck.

What would you do if you needed to query an external database?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13224
  • Karma: +550/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Connect an external database and create elemenets based on queries
« Reply #1 on: April 15, 2016, 04:22:57 pm »
When you say database do you mean "EA Repository" or "other" database.

In case of an EA Repository you should be able to connect to it an use the EA API to query the model.

If "other" then I would probably look at something like ADODB.Connection. What is the issue the the latter approach?

Geert

Anatoly

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Connect an external database and create elemenets based on queries
« Reply #2 on: April 15, 2016, 04:50:29 pm »
I'm trying to do the simplest thing possible:
dim connStr
connStr = "....."

Dim oCon
Set oCon = CreateObject("ADODB.Connection")
oCon.Open connStr

It says "Can't open the connection" and I can't get past that. Though I'm able to open the connection from VBA(Excel) with the very same connection string and code.

Is there something about 32-bit driver and 64-bit machine I'm on? I just don't know what to try now.
« Last Edit: April 15, 2016, 04:52:00 pm by Anatoly »