|
-
Mar 23rd, 2002, 09:30 PM
#1
Thread Starter
Lively Member
Report Question
Hello,
I have a little problem with a report.
I use this code to call the report :
On Error GoTo damn
DataEnvironment2.Commands("calendar").CommandText = "select * from calendar where time=""" + Text1.Text + """ And Date=""" + Text2.Text + """"
DataReport1.Refresh
DataReport1.Show
Exit Sub
damn:
MsgBox "Error creating report."
this works fine. But the thing is, its like it caches the results. As when text1 and text2 change, and I recall the report, I get the same result!
at first I thought it was a problem with my SQL, so I created another button to acall the same report but with a different SQL line.
On Error GoTo damn
DataEnvironment2.Commands("calendar").CommandText = "select * from calendar where Date=""" + ListView1.ListItems(1).SubItems(1) + """ order by time"
DataReport1.Refresh
DataReport1.Show
Exit Sub
damn:
MsgBox "Error creating report."
anyway, this works just fine also. But then when I try to call the the report with the other code, I get the results for this one.
If that makes sense. Essentially, I am changing the SQL statement every time I call the report, but it seems to be "caching" the report and showing me a previously called one instead of the one I just called.
Does that make sense?
Does anyone know a cure?
Thanks alot
-
Mar 23rd, 2002, 10:41 PM
#2
Thread Starter
Lively Member
^
so no-one knows why my report is showing a previous SQL query instead of my new one?
-
Mar 23rd, 2002, 10:45 PM
#3
Junior Member
ya, its pretty simple actually, and when i had this problem i was tearing my hair out for 3 days, lol.
the dataenvironment command's recordset is still open, simply close it and you'll be fine
the record set close command should be something like DataEnvironment2.rsCalender.Close
people who insist on calling assembly "assembler" should have their pc's taken and be given a bristle buddy building set
-
Mar 23rd, 2002, 10:47 PM
#4
Thread Starter
Lively Member
Originally posted by drefsab
ya, its pretty simple actually, and when i had this problem i was tearing my hair out for 3 days, lol.
the dataenvironment command's recordset is still open, simply close it and you'll be fine
the record set close command should be something like DataEnvironment2.rsCalender.Close
excellent thanks alot!
Works perfectly now, Thank you so much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|