• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 399
  • Last Modified:

VB Datagrid and ADODC data problem when refresh

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
acac
Asked:
acac
  • 5
  • 4
1 Solution
 
twalgraveCommented:
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
 
acacAuthor Commented:
hi Grave, thx the advice.  Both the steps were done already.

Any more hint?
0
 
twalgraveCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
acacAuthor Commented:
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
 
acacAuthor Commented:
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
 
twalgraveCommented:
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
 
acacAuthor Commented:
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
 
twalgraveCommented:
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
 
twalgraveCommented:
Thanks for the points and have a great day!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now