SQLite Interface Plugin - A plugin that allows SMath Studio to interface the SQLite relational database engine - Messages
WroteI am trying to upload the plugin to the extension manager.
http://smath.info/upload/Extensions.aspx redirects me to http://smath.info/ReleaseManager/ which unfortunately results in a Server Error for me ExtensionManagerError.zip (1 KiB) downloaded 132 time(s).
Would anyone happen to know how to get around this?
Only Andrey can fix this issue; in the meanwhile you can prepare the project to be committed in the SVN (prepare project file)
If you don't have yet a SVN access, send a mail or a PM to Andrey.
Off-hand I'm not sure what could have caused this problem. I'd be however happy to have a look, if you would upload or PM me your sheet and database. Likewise I'd be happy to help you with any questions you may have regarding SQLite and usage of the SQLite plugin in SMath (to the best of my abilities). I'll send you one of my Inductor Calculation sheets for reference (Sorry, Electronics Engineer myself

Electronics? I would've guessed structural using AISC beam tables as examples

Edit: Never mind - I see the post about problems uploading to Extensions Manager now.

File not found.File not found.File not found.
SQLLite Plug-in can be installed using Extensions Manager only starting from SMath Studio 0.98.6089. Previous versions of the program cannot install this plug-in correctly. I would highly recommend you to upgrade.
BTW: If you see error message with "GUID: 00000000-0000-..." then you are using old version of the plug-in. Please delete it and install latest one using Extensions Manager with SMath Studio 0.98.6089 or higher.
Best regards.
WroteHello.
SQLLite Plug-in can be installed using Extensions Manager only starting from SMath Studio 0.98.6089. Previous versions of the program cannot install this plug-in correctly. I would highly recommend you to upgrade.
BTW: If you see error message with "GUID: 00000000-0000-..." then you are using old version of the plug-in. Please delete it and install latest one using Extensions Manager with SMath Studio 0.98.6089 or higher.
Best regards.
That's odd. I had already updated to 6089 first thing this morning. Last week, I had gotten the plugin to work doing the original manual extraction of Chris's zip file to the plugins directory, but then it had stopped working at one point, and it seemed like I could only get it to open a database file once after each re-install. Any subsequent attempts to open a worksheet with SQL statements would generate the error that it couldn't open the db file. So after updating SMath to 6089 this morning, I tried and none of the worksheets, mine or Chris's, would open without errors, so I used the delete and install functions in Extensions Manager (6089) to delete the SQLite plugin and reinstall it. It appears to successfully install it, although now I get the error messages previously posted. But just to confirm, I just now deleted and installed using Extensions Manager, in 6089 (as confirmed in the screenshot below), and still get the same error message with the all-zero GUID.

- Have the plugin installed from the Extensions Manager
- Open the worksheets created with old versions of the plugin
- Skip the error messages
- Recalculate
- Save & close the worksheet (program restart not required)
- Open it again


Jason
WroteThanks, Davide. That does eliminate the zero GUID error on subsequent opens of those worksheets,
That's because worksheets were created with a plugin without a GUID; default null GUID was used, hence the error message.
Wrotealthough the "Unable to open database file" error is still present.
Recalculating, saving and reopening, changing variable names, nothing I've tried seems to help.
Your example works perfectly for me (even without eval(...)). Please attach a worksheet and the database, so we can try to understand where might be the issue.

Please try to specify absolute path to the *.db file and ensure this file not used by any other application. If it will help, then it seems there is a bug in the plug-in (may be not, but it is just a first impression).

File not found.File not found.
So, using relative paths in SMath is error-prone. If SMath for each .sm would make its own current path as one where the file is, regardless of opening method, then it would be good. For now, I wouldn't advise anyone to use relative paths.
Jason
WrotePlease note that if you double-click the .sm, then SMath opens with the directory where the .sm located as current path; so all subsequent relative paths will be searched under this directory. But if you start SMath from, say, desktop shortcut, and then open the .sm from it, then current directory will be that was specified in the shortcut. The same will happen if you opened SMath by double-clicking one .sm, (and its path is now current directory), and then from that SMath open another .sm from another directory: the second directory won't be current one.
So, using relative paths in SMath is error-prone. If SMath for each .sm would make its own current path as one where the file is, regardless of opening method, then it would be good. For now, I wouldn't advise anyone to use relative paths.
This explains everything, thank you Mike

But this is even poor implementation in the plugin and can be solved easily (fix the same issue yesterday in my WriterRegion)
- Check if path is rooted (absolute); if yes go to step 3, otherwise go to step 2;
- If the path is relative, build an absolute path;
- Use the output path
string path = "whatever";
// internal checks: a filename is specified, etc, etc, ...
path = Environment.ExpandEnvironmentVariables(path);
if (!String.IsNullOrEmpty(context.FileName) && !Path.IsPathRooted(path))
path = Path.Combine(Path.GetDirectoryName(context.FileName), path);
// use path
WrotePlease note that if you double-click the .sm, then SMath opens with the directory where the .sm located as current path; so all subsequent relative paths will be searched under this directory. But if you start SMath from, say, desktop shortcut, and then open the .sm from it, then current directory will be that was specified in the shortcut. The same will happen if you opened SMath by double-clicking one .sm, (and its path is now current directory), and then from that SMath open another .sm from another directory: the second directory won't be current one.
So, using relative paths in SMath is error-prone. If SMath for each .sm would make its own current path as one where the file is, regardless of opening method, then it would be good. For now, I wouldn't advise anyone to use relative paths.
Thank you, Mike!
Seems there is something I should fix asap

with the following changes (link in initial post):
- Made plugin available to download via extension manager
- Changed the way the correct SQLite assemby (for x86 or x64) is loaded to allow installation from extension manager for SMath below 8069
- Uploaded source code and example to SVN
- Small changes to example file, added separate example file for older SMath versions
- Fixed relative path as suggested by Davide
Thanks again for all the helpful tips, suggestions, discussion.
Please excuse the time this fix took, I was unfortunately tied up with work commitments.
Sorry for any problems that have occured in the meantime (e.g. the GUID 000... problem).
I suggest to delete whatever version of the SQLite plugin is currently installed and get a copy using the extension manager where possible and only install manually if necessary.
Wrote
SQLLite Plug-in can be installed using Extensions Manager only starting from SMath Studio 0.98.6089 Previous versions of the program cannot install this plug-in correctly.
This was the case at the time Andrey posted this helpful comment, I have now however changed the plugin to allow SMath versions lower than 0.98.6089 to install the plugin correctly.
Wrote
But this is even poor implementation in the plugin and can be solved easily (fix the same issue yesterday in my WriterRegion)string path = "whatever"; // internal checks: a filename is specified, etc, etc, ... path = Environment.ExpandEnvironmentVariables(path); if (!String.IsNullOrEmpty(context.FileName) && !Path.IsPathRooted(path)) path = Path.Combine(Path.GetDirectoryName(context.FileName), path); // use path
Thanks for this code Davide, I have pretty much used it as is and it works nicely.
I have tried to move the SQLite plugin forwards to use the IPluginLowLevelEvaluationFast interface, based on what source code I could find within the SVN. Conversion from Terms seemed still necessary and I could not reliably measure runtime improvements and have for the sake of compatibility reverted to the standard IPluginLowLevelEvaluation. As soon as more info about using Entry is available and a new Stable SMath version is released I will try to implement IPluginLowLevelEvaluationFast.
SQLitePlugin.pdf (31 KiB) downloaded 115 time(s).
double num3 = (double) sqLiteDataReader[ordinal];
double num3 = Convert.ToDouble(sqLiteDataReader[ordinal]);
I fixed it myself in the public repository. Andrey Ivashov rebuilt the plugin.
-
New Posts
-
No New Posts