BusinessObjects Board

Getting freehand-SQL queries using VBA macro

Hi,
I am new to BO/VB macros. Can I get some help of API to get freehand-SQL queries using VBA macro.

My BO version is 5.1.6

Thanks,
CC


chittari (BOB member since 2006-08-15)

Your question is slightly confusing.!!

As per my understanding:
If you are looking to get the SQL from FH SQL Data Providers, then I have not tried for FH Sql :nonod:

You can search in the forum, For FH sql Data Providers it might or may not be possible because it might not have exposed to VBA I think. ?


BO_Chief :us: (BOB member since 2004-06-06)

Thanks Chief. You got me right.

In such case, Is there any way to find the list of formula’s used?


chittari (BOB member since 2006-08-15)

Hi Chittari and welcome to B :mrgreen: B

in my BO 6.5.1 installation this VBA code gives me the SQLs of all data providers, free-hand SQLs included:


Sub DP_SQLs()
  For i = 1 To ActiveDocument.DataProviders.Count
     MsgBox "data provider " & i & ":" & Chr(10) & ActiveDocument.DataProviders.Item(i).SQL
  Next i
End Sub

I am not sure if that works in BO 5.1.6. Give it a try and see for yourself.


Marek Chladny :slovakia: (BOB member since 2003-11-27)

wow…that works…
Thanks a lot Marek Chladny


chittari (BOB member since 2006-08-15)

You are welcome. 8)

Good to know that it works also in BO 5.1.6 :yesnod:


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Hi Marek,

In my code I am trying to log in to BO 6m5 opening report.
This works fine

My requirement is to get sql queries and print this Into msgbox Or cmd screen.
While trying to use your code of line it is giving me syntax error.


Tejal Chauhan (BOB member since 2020-03-01)