How to refresh free hand sql dataprovider through vb code...

Hi,
i have a dataprovider created in form of free hand sql to which i m passing the sql query as a string through vb code. Now i want to refersh that dataprovider through vb code with the new sql.
Is their any way to do this…

thanks,
-KK


Kaily (BOB member since 2004-06-29)

Data providers have a .Refresh method.

Dim DataProv as DataProvider
Set DataProv = ThisDocument.DataProviders("your data provider name")
DataProv.SQL = "Select blah, blah, blah"
DataProv.Refresh

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

Thanks Dwayne,
but i have already tried that way…my problem is i’ll be passing the dates to the sql string (start date and end date) which are calculated in vb code…
evry time when i m running the report these dates will be passed to sql…

now i m able to pass the new sql as string to the free hand sql dataprovider… but not able to refresh that… it is giving me error saying

  1. “Cannot find the Universe ‘’ or you do not have any rights on this
    Universe (DA008)”.
  2. “A connection is required to refersh this document is unavailable(DA004)”.
    :confused:
    i m using free hand sql on sample universe called “beach.unv”…

thanks,
-KK


Kaily (BOB member since 2004-06-29)

What do you mean by

Is it a Free Hand SQL or universe based one with SQL modified in it.

Would it possible for you to post the VB code which you are using ?


JaiGupta (BOB member since 2002-09-12)