Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: bachristus on November 23, 2011, 08:57:44 pm
-
What should connection string look like to connect to repository by Repository.OpenFile() or Repository.OpenFile2()?
I tried to pass the connection strings generated in EA using DSN ("DSN=XXX;SERVER=YYY;UID=UUUU;PWD=pppp;DATABASE=dddd;PORT=3306") - and I get exceptions thrown.
-
Best to create a "shortcut" eap file (use "Save As") and open that file with a text editor.
Geert
-
The conn_string should be like:
Repository.OpenFile("C:\Test.EAP")
To catch connection string of current project use: Session.Output Repository.ConnectionString
-
The conn_string should be like: Repository.OpenFile("C:\Test.EAP")
To catch connection string of current project use: Session.Output Repository.ConnectionString
Excuse me but you just shortly repeated the API manual ::)
I need to connect to remote DB repository.
What I need is how to connect to repository not having DSN configured and .eap files created?
-
Have you tried the "Save As" suggestion?
Geert
-
Connection String to remote EA rep:
ea_sqlserver --- DBType=1;Connect=Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=ea_sqlserver;Data Source=ALM-SRV;LazyLoad=1;
Create on remote OS a *.UDL-file and specify type DBMS. Then open *.UDL-file with Notepad.
Probably it is necessary to add the database name before DBType=1.
The received conn_string can be used in a script with OpenFile() or OpenFile2().
I hope that I have understood you correctly :)
-
Have you tried the "Save As" suggestion?
Geert
Yes and it works. But... I need to connect to DB server without data source configured. It could be different DB and I have no access to the computer where my code should work. I have just server name, db name, credentials, port, db driver. Is there any way to open repository using just this info?
-
Connection String to remote EA rep: ea_sqlserver --- DBType=1;Connect=Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=ea_sqlserver;Data Source=ALM-SRV;LazyLoad=1;
Create on remote OS a *.UDL-file and specify type DBMS. Then open *.UDL-file with Notepad.
Probably it is necessary to add the database name before DBType=1.
The received conn_string can be used in a script with OpenFile() or OpenFile2().
I hope that I have understood you correctly :)
"DBType=1" - what does it mean?
-
means SQL Server.
EA has a number for each type of supported database.
Geert
-
Is there any reference or manual on how to build this connection strings?
I just want to path the information which I was using to create DSN to some method, build proper connection string and get Repository.OpenFile() or OpenFile2() work.
-
Google is your friend. That's what I found found out.
q.
-
Could somebody provide the list of "DBType" values for each supported DB?
-
I did not check. But it can be correct:
0 -- None
1 -- SQL Server
2 -- Oracle
3 -- MySQL
4 -- ODBC
-
using the search button on the forum I got:
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1274978209/4#4
Geert
-
using the search button on the forum I got:
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1274978209/4#4
Geert
For some reason this search button returned nothing to my "DBType" search ;D
Thank you
-
Really important information!
Thank you, Geert.
-
Well, its kind-of a trick.
You have to use to top-left search button and not the top right search box.
Once there don't forget to change the "This post was made in the last..." to (all posts) because by default it will only search posts a week old.
(talking about a useless default!)
Geert
-
Thanks Geert - your post is prob the most useful thing I have read on this forum. I've been using that search box for about a year, and not noticed that other search button.