patrickTingen / DataDigger

A dynamic dataviewer for your Progress / OpenEdge databases
https://datadigger.wordpress.com/
MIT License
50 stars 23 forks source link

[progress 10] unknown field in VST when checking indexinformation #90

Closed Sil-Boydens closed 2 years ago

Sil-Boydens commented 2 years ago

problemdescription

an error pops up when selecting a table in a progress 10 database because a non-existing field was queried.

repro steps

connect to progress 10 database using datadigger running on progress 11 select a table in the table browse image

additional information:

release DD26-rc2 i found the error while having both pogress 11 and progress 10 database connected and selecting a progress 10 table. tried again with only a progress 10 database selected and same issue.

if browsing databases from other versions then the one running, isn't supported, let me know.

patrickTingen commented 2 years ago

Hi, this is something I had not forseen, I will see if I can check the version of the database. Currently I check the version according to the version that is running DD. Workaround is to use DD in 10.1c for V10 databases

Gr Patrick

Op di 24 mei 2022 15:06 schreef Sil-Boydens @.***>:

problemdescription

an error pops up when selecting a table in a progress 10 database because a non-existing field was queried. repro steps

connect to progress 10 database using datadigger running on progress 11 select a table in the table browse [image: image] https://user-images.githubusercontent.com/81414132/170040459-d1090852-7389-466b-a41b-7c22fcf71174.png additional information:

release DD26-rc2 https://github.com/patrickTingen/DataDigger/tree/DD26-rc2 i found the error while having both pogress 11 and progress 10 database connected and selecting a progress 10 table. tried again with only a progress 10 database selected and same issue.

if browsing databases from other versions then the one running, isn't supported, let me know.

— Reply to this email directly, view it on GitHub https://github.com/patrickTingen/DataDigger/issues/90, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABN3AHO2XI4TWT3LJRFCQLDVLTH4JANCNFSM5WZQEERQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Sil-Boydens commented 2 years ago

You don't need to check the db version, as a progress database can technicly (while not recomend or officially support) run with VST's from an older version if that db has been upgraded from an older version without updating the VST's.

you can check if a buffer has a field or even check if a table exists. That way you are sure you are running code that works on the current VST's

FUNCTION buffer-has-field RETURNS LOGICAL
    (hBuffer AS HANDLE, cField AS CHARACTER):
    DEFINE VARIABLE hField AS HANDLE NO-UNDO.
    ASSIGN hField = hBuffer:BUFFER-FIELD(cField) NO-ERROR.
    RETURN hfield <> ?.
END FUNCTION.

FUNCTION get-buffer RETURNS HANDLE
    (cTable AS CHARACTER):
    DEFINE VARIABLE hBuffer AS HANDLE      NO-UNDO.
    CREATE BUFFER hBuffer FOR TABLE cTable NO-ERROR.
    RETURN hBuffer.
END FUNCTION.

MESSAGE get-buffer("_LobStat") <> ? /* true on progress 12, false on lower versions */
   SKIP buffer-has-field(BUFFER _StorageObject:HANDLE, "_object-state") /* false on 10 and lower, true on 11 and higher */
    VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
patrickTingen commented 2 years ago

Ah, of course, that's a better solution. Will see if I can use this, thanks!

Kind regards Patrick Tingen

Op di 24 mei 2022 om 22:21 schreef Sil-Boydens @.***>:

You don't need to check the db version, as a progress database can technicly (while not recomend or officially support) run with VST's from an older version if that db has been upgraded from an older version without updating the VST's.

you can check if a buffer has a field or even check if a table exists. That way you are sure you are running code that works on the current VST's

FUNCTION buffer-has-field RETURNS LOGICAL (hBuffer AS HANDLE, cField AS CHARACTER): DEFINE VARIABLE hField AS HANDLE NO-UNDO. ASSIGN hField = hBuffer:BUFFER-FIELD(cField) NO-ERROR. RETURN hfield <> ?.END FUNCTION. FUNCTION get-buffer RETURNS HANDLE (cTable AS CHARACTER): DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO. CREATE BUFFER hBuffer FOR TABLE cTable NO-ERROR. RETURN hBuffer.END FUNCTION. MESSAGE get-buffer("_LobStat") <> ? / true on progress 12, false on lower versions / SKIP buffer-has-field(BUFFER _StorageObject:HANDLE, "_object-state") / false on 10 and lower, true on 11 and higher / VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.

— Reply to this email directly, view it on GitHub https://github.com/patrickTingen/DataDigger/issues/90#issuecomment-1136394245, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABN3AHLSWVAY4ADNLO2KHGLVLU24PANCNFSM5WZQEERQ . You are receiving this because you commented.Message ID: @.***>

patrickTingen commented 2 years ago

Fixed in my development environment, but cannot commit right now. Find a patched version of DataDiggerLib.p attached that solves this problem. Just drop this file in your DD folder and restart DD. It should recompile itself on restart.

DataDiggerLib.zip

Sil-Boydens commented 2 years ago

can confirm it's working. thanks!!

patrickTingen commented 2 years ago

Thanks for the feedback. To others finding this solution to the same problem: the attached zip only works for DataDigger 26