global gconId
on preopenstack
opendb
end preopenstack
on opendb
put revOpenDatabase("sqlite", "C:/Estimate Data/Estimate Info.dat", , , , ) into tConId
if tConID is "" then
answer warning "Problem creating or accessing database!"
else
answer information "AppReg Connected! Your connection ID is: " & tConID
put tConID into gConID
end if
end opendb
Does anyone have a clue as to why? I have included the database externals but no worky.
Do I need to move the external dlls to the windows folder to work after compiled?
global gconId
on preopenstack
opendb
end preopenstack
on opendb
put revOpenDatabase("sqlite", "C:/Estimate Data/Estimate Info.dat", , , , ) into tConId
if tConID is "" then
answer warning "Problem creating or accessing database!"
else
answer information "AppReg Connected! Your connection ID is: " & tConID
put tConID into gConID
end if
end opendb
just reproduced it. It appears, that the database Libraries are not yet fully loaded on preOpenstack of the mainstack that turns into the application. In the IDE these libs will be loaded already. If you move your script to openStack as sturgis already suggested.
Ok I moved the script to openstack and it still does not work.
Also I tried calling the opendb from a script in a button after everything is loaded and it still does not work.
While making the standalone the database externals are loaded so I have no idea as to why the script refuses to execute and it works so good in the IDE.
OK I finally got it working. I had "on preopenstack" in the stack script and the card script.
Once they were eliminated then the openstack script called the opendb and all is well.
It seems as though if the database connect script is in any "on preopenstack" the script gets set aside and produces no execution or errors. This seems like a bug.
Unfortunately I didn't spot this message until after the solution was found.
For what its worth, the reason for this problem is how Externals (like revDB) are loaded in Revolution standalone applications. Revolution places a hidden group in your stack, which initializes the externals when it receives its first preOpenBackground message. Once this has happened, everything works fine, but if you try to connect before this, (e.g. on preOpenStack) then it will fail.
I've posted a comment to the revOpenDatabase function to explain this and hopefully help prevent people having this problem in the future.
Regards
Oliver
Oliver Kenyon
Software Developer
Runtime Revolution