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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

runtime designer field list update

Status
Not open for further replies.

dmitry1

Programmer
Oct 22, 2002
8
RU
Hello.
I use vb6 & cr8.5 & mssql2000,
and there is a problem with run-time design.

1. I create view in server, then create rst as adodb.recordset in vb and open it from view.

2. I create CrystalReport and place rst as datasource for report.

Set cr1 = crApp.NewReport
cr1.Database.AddADOCommand rst.ActiveConnection, rst.ActiveCommand
cr1.Database.SetDataSource rst

3. open cr1 in runtime designer and do with it all I want and then save it to file.

4. next time, when I need to print this report, I open it from file, set the datasource for it and voila

Set cr1 = crApp.OpenReport(report_file_name)
cr1.Database.SetDataSource rst

5. now I can print it and all works correctly.

the trouble appears when I add a field to view in server, and this field appears in recordset too. Okay, I use "Set Location" from designer menu, there I build connection string (?) to my server, then there appears the "select recordset" window, and there I write query text, which returns right field set (like "select * from my_view"), and report's field set updates as I need.

So, the question is: how can I do this "field list update" from program code, without using designer menu?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top