|
-
May 12th, 2005, 05:55 AM
#1
Thread Starter
New Member
is my code being skipped???????
Hi
I have a strange problem. my program flow is like this..
in a single procedure
step 1 : manualy enter data in fields(text boxes)
step 2 : save the data into to an access table(DAO)
step 3 : using crystal reports 8 fetch that data and print a report.
i have the necessary code in a command button(print button)
what happenes is when i click print, the data is being saved in the table
but nothing gets printed in reports.
there is nothing wrong with my code, as every thing works perfectly
when i trace the program..
but when i run that same program, nothing is being fetched by crystal reports.
my assumption was, even though i insert values in to the table,
crystal report is fetching before the data is actualy is written in the table.
i came to this solution because if i give a msgbox between insertion of data
and fetching by crystal reports, its working fine.
so i wanted to delay the excecution of the fetching code.
i came to a solution like this
------insert-------
for i = 1 to 100000000
'some calculation
temp = temp / 434.435
next i
-----fetch------
my machine was p3 866, 128 megs ram.
the above loop delayed the execution by some 4 seconds.
and i got my desired output. fetching happened properly after insertion.
but when i run the same code in a p4 machine, the loop only takes a fraction
of a second and i am back to same problem again....
any solution for my problem..
Thanks
Easwaran
-
May 12th, 2005, 11:09 AM
#2
Re: is my code being skipped???????
Welcome to the forums.
Is the report bound to the table?
-
May 13th, 2005, 02:25 AM
#3
Thread Starter
New Member
Re: is my code being skipped???????
Hi,
by bound do you mean the connection between vb and crysral reports.
i have connected crystal reports and vb thru "crystal report control"
as the report is generated properly when traced(F8) , i assume my connections are fine and the report is bound to vb.
Thank you..
Easwaran.K.V
-
May 13th, 2005, 03:04 AM
#4
Re: is my code being skipped???????
There is a caching problem/issue with dao.
When you update the db it is not immediately updated (I found a link somewhere about this I'll see if I can redig it up and post you a link.
Essentially you need to flush the cache of the db once you've closed the recordset you've updated. Then the db and anything looking at it should pull the right data.
Edit:
One thread
Try searching under JRO and CacheRefresh (or RefreshCache)
If you are using DAO its in the dbengine or application (I think) Or was there somewhere. I used it with a DAO connection to access 97 from vb5. I had the same problem that the record data was in the tables but wasn't getting there before the program queried the table.
I'll see about other links...
KB MSDN link, More MS stuff
JRO looks like the only way to go. Could've sworn there was another way.
>>> DBEngine.Idle dbRefreshCache <<<
DAO (heheh) and possibly the Access Application - forces the db to finish stuff off
Last edited by Ecniv; May 13th, 2005 at 03:31 AM.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
May 17th, 2005, 06:41 AM
#5
Thread Starter
New Member
Re: is my code being skipped???????
Hi Thanks for your reply..
I have found a workaround that works for now..
step1: insert values
step2: update recordset
step3: close recordset
step4: open table again by select * query
step5: close without any operations
step6: carry on with crystal reports
steps 4 & 5 make the difference.. It works for now , but i am not sure
of the method that it will work all times..
Thanks again for your reply
Regards
Easwaran.K.V
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
|