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

VB6 Data Report

Status
Not open for further replies.

softscot

Technical User
Mar 10, 2004
1
GB
I am using data report with the data environment.
The first time I run the report from within my program it works OK.
Running the report again shows the same report as before - no changes to the data are shown.
If I stop the program and restart then run the report it now shows all the changes.
How can I achieve this without stopping the program.
Any help would be appreciated.

 
you need to refresh the dataset and the datareport. Try myRecordset.refresh

BB
 
If using a DataEnvironment I would close and re-open the connection

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Johns got the right idea, At the beginning of your connection check to see if the connection is already open, thus:

Dim SQLstring As String

If DataEnvironment1.YourCommand.State = 1 Then GoTo ReQuery

SQLstring = "Your SQL String"
DataEnvironment1.YourCommand.CursorLocation = adUseClient
DataEnvironment1.YourCommand.Open SQLstring
GoTo loadit

ReQuery:
DataEnvironment1.YourCommand.Close
SQLstring = "Your SQL String"
DataEnvironment1.YourCommand.CursorLocation = adUseClient
DataEnvironment1.YourCommand.Open SQLstring

GoTo loadit

loadit:
'Continue with the new information


The Goto statements are a little old school but I am sure you will for forgive me.

~Lynus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top