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

Refreshing ADO & crystal reports

Status
Not open for further replies.

JDPurtell

Programmer
Aug 13, 2001
9
0
0
US
The issue is when I enter data into a data grid and then call up a report which references the data it is not being updated properly. Well when I close down the program and then re-run the application it works fine. So I thought instead of just using the adodc1.refresh method I will close & re-open the db connection.(a hack move I know but must meet a deadline) Well that did not even work. The only thing that works is shutting down the app and bringing it back up. Any help on how to get the database to accept the changes would be great!!

I have looked through the past posts and nothing is working. Thanks
 
Strange you have to restart the application for the changes to be noticed. Are you calling a Recordset.Update before trying the report? I know that even in a DataGrid, the data is not automatically updated until the user moves to a different record, or .Update or .CommitTransaction is called. Until then the information on the newly added record is just sitting static inside the grid control, never having been committed to the actual database. That would also explain why Refresh isn't working, since Refresh will only recollect the info in the database, without commiting any transactions.

Hope that's it!

-Mike Difference between a madman and a genius:
A madman uses his genius destructively,
A genius uses his madness constructively.
 
Thanks for the thought Mike. I looked into it but I am using a commandtype of adcmdtext and not a specific recordset. So I can not use the .update or the .CommitTransaction. Any other thoughts?
 
You do have some sort of recordset object declared, don't u? What is the grid bound to?

Dim RS as ADODB.Recordset
RS.Update
Difference between a madman and a genius:
A madman uses his genius destructively,
A genius uses his madness constructively.
 
Alright I figured out how to access the recordset properties properly. Everything works great when I add or update the recordset. When I delete a record is when I have problems. The problem now is that I do an .update then a .requery and the record I deleted re-populates in the grid. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top