?
Solved

VB Datagrid and ADODC data problem when refresh

Posted on 2003-02-20
9
Medium Priority
?
394 Views
Last Modified: 2010-04-17
I am using datagrid with ADODC. The grid is for display only, so I set it as "update not allowed". And there's nowhere will change this property.  I change the data to be displayed by change data srouce of the ADODC. The applicaiton get refresh every, say 2 mins, with the right-the-moment ADODC data source.  Users were performing operation by click on the diffrerent columns of the grid to call a menu and some stored procedures will be called via the menu to perform corresponding actions (i.e. no data manipulation via the grid).

However, some abnormal data were created to the database during daily using of this application. It looked like when I was stopping the arrow at column 1 of row 12, for e.g.; and just happen it was time to refresh, then the data at first column of first row will be replaced with content of col 1 row 12 -- and one new records was created in DB.  This happens 1 out of about 20 times of refresh.  Howver, actually I am still not 100% sure if this was really created by the refreshing or some other properties or events among the grid.

Has any one experienced such sutiation before? how was it caused and the sulotion?  

Or can any one have a rough idea about the occurence and thus suggest some preventive methods?

1000 thx in advance.


0
Comment
Question by:acac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 16

Accepted Solution

by:
twalgrave earned 150 total points
ID: 7987525
Try a couple of things:
1) Put a doevents at the top of the timer
2) Put a Grid Disable at the top of the timer and a grid enable at the bottom
0
 

Author Comment

by:acac
ID: 8006633
hi Grave, thx the advice.  Both the steps were done already.

Any more hint?
0
 
LVL 16

Expert Comment

by:twalgrave
ID: 8007970
The only other thing I can recommend is to implement call stack handling and logging to see what routine called what routine and so on when this corruption occurred.  This will entail putting call stack pushing and popping to a collection or something, then displaying those contents to a file whenever you hit the refresh code.
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

Author Comment

by:acac
ID: 8017684
Grave, I am new to VB so not able to fully understand how to do what you recommend. Thx u anyway. I am going to solve it at SQL server side.

I am also new to here. Can you tell me some about here by the way? Is that if I accept your comment as answer and you will gain the 50 points? (I'd like to do if so)  and I can also gain some points for myself by answering other's question?

cheers
0
 

Author Comment

by:acac
ID: 8017800
Grave, I am new to VB so not able to fully understand how to do what you recommend. Thx u anyway. I am going to solve it at SQL server side.

I am also new to here. Can you tell me some about here by the way? Is that if I accept your comment as answer and you will gain the 50 points? (I'd like to do if so)  and I can also gain some points for myself by answering other's question?

cheers
0
 
LVL 16

Expert Comment

by:twalgrave
ID: 8017844
Yep, I can tell you all about this site.

Next to the header near my comment is a link that says "Accept Comment As Answer".  If you'd like to accept my comment, click that link.  This will take you to the grade page.  Typically if you assign anything other than an A, an explanation should be accompanied in another comment after the grading.  You select the grade and submit and the question is closed out.  

If for any reason, you desire to delete a question and have your points refunded or modified for a point split, or have problems with another member of this site, post a zero-point question in the community support topic area located on the list at the left of the page.  Make sure to reference the question number or copy the URL for the question you want worked on.  For instance, you can see from the address of this page that this is question 20522399.

As far as how to answer questions, you must first become an expert to do that.  See here for how to become an expert: http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp#18

It is important to note that once you reach 10,000 expert points, you qualify for the ad-free version of Experts Exchange the month after you reach the 10k mark.  Then all you need to do is to maintain 3k per month to keep the ad-free version (packed with extra features too like advanced searching, the ability to keep your favorite site links at the top of the page, etc).

I hope this helps you.  I can answer more if you'd like.  Also, in the upper middle of the page is a link to the help desk where lots of questions can be answered and if you expand the community support link at the left of the page, you will see an area called New To EE.  This has lots of tips for a better time at Experts Exchange.

I really love this site and I look forward to the day you help somebody else!

Take care.  If you need anything more, don't hesitate to drop a line here (you can still have a dialog once a question is closed by the way).
0
 

Author Comment

by:acac
ID: 8024749
I got it finally, after set below 2 properties in the ADODCs:

ADODC.LockType  --> adLockReadOnly
ADODC.Mode  -->  adModeRead

Alternatively, I was thinking to set a trigger in the SQL server to reject the update if that was about the specify column.  I think this alternative should work as well.

cheers

0
 
LVL 16

Expert Comment

by:twalgrave
ID: 8025204
I'm glad it's working for you.  I don't really like the trigger option for two reasons:
1) It causes unnecessary network and database traffic
2) You may need to trap for errors as a result of the trigger causing the stop (you might not depending on how you write the trigger).

You now have 2 options for closing this question

1) Accept an experts's comment as described above
2) Post a zero-point question in community support asking for a refund as described above.

0
 
LVL 16

Expert Comment

by:twalgrave
ID: 8025688
Thanks for the points and have a great day!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question