C
cverbiest
Guest
I found a solution to my problem, dbparam helps, but not connecting because dbparam ne ? results in the connection going away at the end of the execution when custlib.p is cleaned up by the procedure editor. A new connect statement ensures the database remains connected. If the new connect tries to connect to a different db you get a second errormessage Database physical names sp2k2 and sp2k do not match. No connect. (1018) I can solve my issue by catching the error and checking for the error numbers. def var hlib as handle. if not connected("sp2k") then connect sp2k. run custlib.p persistent set hlib. message dynamic-function("custinfo" in hlib, 1) view-as alert-box. disconnect sp2k. if connected("sp2k") then do: message "sp2k is connected, ok" view-as alert-box. end. else do on error undo, leave: connect sp2k -ld sp2k. catch e as progress.lang.error: if e:getmessagenum(1) = 1012 and e:getmessagenum(2) = 0 then message "Same database already connected : OK" view-as alert-box. else message e:getmessage(1) skip e:getmessage(2) view-as alert-box. end catch. end.
Continue reading...
Continue reading...