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
625 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now