Solved

How do I detect a change to a blob datawindow column using the db ole in powerbuilder 10

Posted on 2009-07-08
6
628 Views
Last Modified: 2013-12-26
I am trying to give the user a way to save multiple form types from a single source i.e. word doc, excel, powerpoint. I can open up the various applications and save and retrieve the information. My problem is how do I detect a change to the document so I don't have to prompt the user to save when nothing has changed. I used get changes, compared get full state blob legnths but none of this is effective.
Thanks
LW
0
Comment
Question by:lwski
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
IncisiveOne earned 250 total points
ID: 24810417
Easy.  What you need is a checksum function.  Exec checksum on all the bytes in the entire blob, this will produce one 32 bit value; do the checksum again at the end; compare the two checksums; if they are the same, the doc is unchanged.

I have not coded in PB for a few years, I do not recall if it has a checksum function.  PB 10 was not around then, it may have.  Otherwise you have to see if you can find a class object that someone has written and published.  Or write your own (that's not too difficult, but it will take time; search the web and find out how it is done).

Cheers

0
 
LVL 18

Expert Comment

by:diasroshan
ID: 24811332
0
 
LVL 6

Expert Comment

by:IncisiveOne
ID: 24813994
Storing both images in a db, and comparing them would be very slow and resource intensive, compared with calculating a checksum in pure memory.
0
 
LVL 4

Assisted Solution

by:Lordain
Lordain earned 250 total points
ID: 24914812
Another possible solution concept is to put a trigger on the database to update a timestamp column whenever your blob column is updated.  Then you just have to check if the timestamp has changed then you know something was updated.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

776 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