BusinessObjects Board

create report and add query with vba

Hi Guys,

I’m a new to BO using VB. I’m trying to create a document and add a query to that (see code below). But as soon the line:

Set q = d.DataProviders(1).Queries.Add

get runs I become following Error message “The Query does not reference a Table (QP0007)” . Can someone help plz?
Thx Ahmed


Sub Test()
Dim bo As busobj.Application, d As busobj.Document, r As busobj.Report, q As busobj.Query

'start bo
Set bo = New busobj.Application
bo.LoginAs inputbox "username", , inputbox "pass", , "PROD"

bo.Visible = True
'bo.Interactive = False
Set d = bo.Documents.Add


d.DataProviders.AddQueryTechnique "Production Universe"

Set q = d.DataProviders(1).Queries.Add

q.Results.Add "Core Information", "Product"


End Sub

AhmedUsein (BOB member since 2004-07-28)

First, welcome to BOB … we hope you will find it a useful resource.

Second, I encourage you to review the Introduction to SDK (or something like that) document. I believe it gives an example.

Third, feel free to review the code in this BOB Download. It is quite thorough in the steps of creating a data new provider.

Good luck with your project … and again, welcome.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Hi Dwayne ,

unfortunately i dont have that sdk document. The BOB Download is not a real solution since Im not quite sure which part would be appropriate use. plz dont forgen, Im new to VB. Isnt faster if you comment my code and give me a feed back if im doing something wrong? Thx
Ahmed


AhmedUsein (BOB member since 2004-07-28)