Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reuse in VB the connection defined in Designer

Status
Not open for further replies.

shqiptar

Programmer
Apr 8, 2003
9
0
0
BE
Hello,

I use BO reports containg VBA macroes with VB prompts in them. Before the refresh starts these prompts perform various queries on the db and the fill out the BO prompts, and then the dataproviders refresh.

For this we have defined a new connection in the VBA code. I would like to know if there is a way within the report to use the parameters of the connection defined in the universe. This has two good reasons
1. Why create a parallel connection when the report already has one?
2. In the univers you already have a user/password, which you would have to hardcode in a parallel VBA connection

I would like to know if anyone has managed to use within VBA the connection defined within BO itself.

Many thanks,

Toni

(another issue related to it is to be found in the post
Programmers > Languages > VBA Visual Basic for Applications (Microsoft) Forum :
"define a connection in a dll/ocx?"
thread707-752569)
 
Very interesting question, I have reused the SQL query defined in a report, but never used the universe connection.
I'll let you know if I'll find out something.

Stick to your guns
 
This may sound strange coming from a non-SDK person, but I don't think you can do this. BO is a VERY secure product. If you could access the connection via the API, it would be WAY to easy to write an application that could bypass the universe and let users see data they are not allowed to see.

If I was a betting man, I'd bet (and hope) that this isn't possible.

Steve Krandel
Westbay Solutions
 
Hi, after checking I see (again) that with BO SDK you can just refresh the dataprovider, this sounds like you can setup custom SQL and have the DP execute that query.
Otherwise, with DesignerSDK you can access all properties of a dataprovider.
So shqiptar I think this answers your question.

Steve, I'm sorry but BO's security is not better than that of any other application, basically the connection used for reporting should be able only to do selects on defined objects.
And things like keeping encripted (BO) passwords in the database is just FUD and does not improve security.

Stick to your guns
 
Yes, in theory I should be able to do it with designer sdk, but I don't see how, I don't see anything that leads me to the connection... Did you manage to get the connection password by use of code?

Anyway, thanks for the suggestion

Toni
 
I'm sorry to ask, but I have to, have you licensed the SDK?
Note that you need a valid licence to access the Docs.
Anyway docs state that (BO SDK) every DB has a SQL property (read/write) which I suppose can be used to programmatically write freehand SQL and run it.
Otherwise the Designer SDK allows you to access the Connection object which has a Password (read/write) property.

Stick to your guns
 
Well yes, I do work for a serious company. So I guess if I can use the sdk, it is correctly licensed. But I cannot manage to get from the report (activedocument) to the universe. I can refer to busobj.universe, but not designer.universe. I'll keep looking
 
You can find all informations in the docs, the object model is pretty clear.

Stick to your guns
 
I did look actually. I found a way to retrieve the password. That killed me. The password I retrieved was ***. Ain't this cool?
I guess I'll stick to my parallel connection.

Cheers,

Toni
 
The password was "***" or showed like "***" ? Because * is just a convention, in other words, was it usable in another connection?

Stick to your guns
 
No, the password was three characters long and I got *** from my connection. You get then the password as it is displayed in Designer, therefore it is not usable.

Cheers,
 
Did you try to use it or decided that it is not usable?

Stick to your guns
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top