Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Dataenvironment refresh?


Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2000, 12:10 PM
swift
Guest
 
Posts: n/a
Default Dataenvironment refresh?


I find that my datareports don't ever reflect changes I make to the database, unless I quit my program and re-run it. Is there a way to refresh the dataenvironment?


Steve

Reply With Quote
  #2  
Old 08-09-2000, 03:56 AM
karimahta karimahta is offline
Senior Contributor

* Guru *
 
Join Date: Mar 2000
Location: Christchurch, New Zealand
Posts: 470
Default Re: Dataenvironment refresh?

This is actually a known issue (except in Microsoft, I think)
I have an article on it stashed aways somewhere and will post it when I find it.

Alternatively, do a search on the past few months for "Data Report" or "Data Environment" with "Refresh" and look for my user name as I have posted this before.

HTH

Reply With Quote
  #3  
Old 08-09-2000, 11:29 AM
swift
Guest
 
Posts: n/a
Default Re: Dataenvironment refresh?

Just for the information of anyone else who has had this problem, I thought I'd tell you how I got around it.

Simply put, before I call the datareport, I load the dataenvironment, and then unload it directly after.

Load DataEnvironment1
DataReport1.Show
Unload DataEnvironment1

It has worked for me... If anyone can think of other repercussions this method might have, please tell me.

Steve

Reply With Quote
  #4  
Old 08-10-2000, 12:19 AM
karimahta karimahta is offline
Senior Contributor

* Guru *
 
Join Date: Mar 2000
Location: Christchurch, New Zealand
Posts: 470
Default Re: Dataenvironment refresh?

Excellent hack. Well done! I haven't heard of this solution before.

Cheers

Reply With Quote
  #5  
Old 09-18-2002, 01:09 PM
DoubleDiamond
Guest
 
Posts: n/a
Default

I was having problems with DataCombos emptying when I closed and reopened the Data Environment. NO LONGER THOUGH!! Awesome...a quick solution to a frustrating problem.

THANKS!
Reply With Quote
  #6  
Old 09-30-2002, 08:31 AM
Tweeg Tweeg is offline
Regular
 
Join Date: Apr 2002
Location: South Africa
Posts: 54
Default

Hi guys,

I still have the similar problem. My DataReport still shows the old data. Do u think that perhaps VB is taking a while to add in the data to my Access database?

My report is used in a search area, where the user enters some search criteria and the results are displayed. Then it can be printed.

Any assistance will be appreciated!

Tweeg
Reply With Quote
  #7  
Old 09-30-2002, 09:27 AM
praveensg's Avatar
praveensg praveensg is offline
Junior Contributor
 
Join Date: May 2002
Location: Planet VB
Posts: 359
Default

if u are using ado to populate the report, then u might want to requery the recordset...and then display the report...
__________________
When the going gets tough, the tough get going!!!
Reply With Quote
  #8  
Old 10-01-2002, 01:58 AM
Tweeg Tweeg is offline
Regular
 
Join Date: Apr 2002
Location: South Africa
Posts: 54
Default

Hi

Thanks for the reply. I am using this code to populate the 3 tables on the database (Temp1, Temp2, Temp3):

-----
Dim DB as Database
Set DB = OpenDatabase("C:\LMM\LMM.MDB")

DB.Execute ("Delete * from Temp1")
DB.Execute ("Delete * from Temp2")
DB.Execute ("Delete * from Temp3")

DB.Execute("Insert into Temp1 Select......")
DB.Execute("Insert into Temp2 Select......")
DB.Execute("Insert into Temp3 Select......")
-----

I won't go into detail with the code but I hope u get the gist. Now I have my DataEnvironment based on the 3 temp tables in the database and the DataReport is generated from there.

A few q's arise:

1. How would I refresh this connection?
2. Is this a good way to do this?
3. I know I can use a DataControl but is it ok to have 3 datacontrols on the form - or how can I define a DataControl in code as a variable?

Thanks in advance

Tweeg
Reply With Quote
  #9  
Old 10-01-2002, 05:52 AM
Hasin's Avatar
Hasin Hasin is offline
Centurion
 
Join Date: Sep 2002
Location: Bangladesh
Posts: 118
Default

The solution is Easy.

Suppose you command name under connectios is command1

The before showing the datrareport please use the following code

Code:
On Error Resume Next dataenvironment1.rscommand1.requery datareport1.show

This will solve all your problem.
__________________
Hasin Hayder
http://www.vbsthopoti.cjb.net
Lead Programmer - EvelinDev
Things that are tough takes time - Things that are impossible takes a little more.
Reply With Quote
  #10  
Old 10-02-2002, 01:20 AM
Tweeg Tweeg is offline
Regular
 
Join Date: Apr 2002
Location: South Africa
Posts: 54
Default

Thanks for the response Hasin
Reply With Quote
  #11  
Old 10-02-2002, 09:37 AM
praveensg's Avatar
praveensg praveensg is offline
Junior Contributor
 
Join Date: May 2002
Location: Planet VB
Posts: 359
Default

u got to requery any recordset (that populates the report) u have before showing...
__________________
When the going gets tough, the tough get going!!!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->