Book a Demo

Author Topic: REAL Connection String  (Read 4530 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
REAL Connection String
« on: May 08, 2009, 01:11:20 pm »
When accessing an EA repository, there are three scenarios1:
  • .EAP file (via File|Open)
  • .EAP file (via Connection String)[/color]
  • Server hosted database (via Connection String)
  • Server hosted database via shortcut (Connection String embedded in shortcut)
The EA API (as mentioned in a number of posts) has a Repository.ConnectionString attribute.  

Repository.ConnectionString: String; Read only. The filename/connection string of the current Repository.

Unfortunately (again, as mentioned many times), there is no standard mechanism to return the actual connection string (suitable for using in an OLEDB Connection) in all these three situations.

Can anyone (hint: Sparxians) provide a best practice code to detect which scenario is being invoked and to return the actual connection string in each scenario?

TIA,
Paolo

1 (if there are more, let me know and I'll update this)
« Last Edit: May 11, 2009, 03:22:29 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: REAL Connection String
« Reply #1 on: May 08, 2009, 09:57:29 pm »
Re: 1 perhaps add:
  • EAP file acting as host database (i.e. via connection string versus direct 'file | open' process)
[/s]NOTE: Incorporated above.
« Last Edit: May 11, 2009, 09:29:07 pm by Midnight »
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: REAL Connection String
« Reply #2 on: May 11, 2009, 03:21:36 pm »
Quote
Re: 1 perhaps add:
  • EAP file acting as host database (i.e. via connection string versus direct 'file | open' process)
Is that more explicit David?

Thanx,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: REAL Connection String
« Reply #3 on: May 11, 2009, 09:29:54 pm »
Yes, that's it.
No, you can't have it!