-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors in modImportExport.ExportSource during imex spec export #259
Comments
It looks like there might be a quote character in the IMEX import/export specification. If you are able to identify exactly where this is located in the table, we can probably make a tweak to the add-in to escape those characters in the JSON output. My hunch is that it is either in the Let me know what you find out! 😄 |
You are correct, here's what's in the exported JSON
The problem is it's importing an Excel file where the field name contains quote characters: It's an export from an membership management website. I can't easily change the field name at this point. |
Thanks for the screenshots! That is very helpful to see the additional detail. I see two potential issues here. One is the quotes, which we should be able to work around. The second is the truncating of the column name. Let me do a little testing on my end... |
The fact that the quotes in the key name are not escaped is actually an issue with the This issue is described here, with a pull request to resolve it located here. Incorporating the fix from the pull request seems to resolve the problem by correctly escaping the quotes in the key name. Public Sub testJson()
Dim dTest As New Dictionary
dTest.Add "My ""Special"" column", "data"
Debug.Print ConvertToJson(dTest, " ")
End Sub Before: {
"My "Special" column": "data"
} After: {
"My \"Special\" column": "data"
} I will plan to incorporate this fix in the add-in when I have the chance. It will be good to have that resolved as I could see that coming up in other areas where user-defined values are used as keys in the JSON definition files. |
If a key name includes a special character like a double quote, this should be escaped before outputting as JSON. Fixes #259
@joyfullservice impressive speed. |
This release includes the fix for #259
Thankfully this one was a quick fix. 😄 |
This is still happening in 3.4.17 in the same two imex specs (don;t you hate it when that happens :-) Do you want a new issue or can you reopen this one? BTW, the Add-in is FANTASTIC. I feel so much better now that I can save the project in git... and the ability to do diffs!
|
Some additional info. I tried running the export again today (with 3.4.17) and it got to this state with the selection flashing at a high rate of speed (like it was being continuously refreshed in a loop). I tried capturing it the flashing with SnagIt but that caused This what happened with 3.4.16 the second time and was what led to the leftover .laccdb file that later interfered with the install of 3.4.17. Deleting the leftover .laccdb file then allowed the export to run, with the same two errors on the quotes in the field names. So it appears that you can export once, you get the error, then a subsequent export gets into a loop. With the following sequence of events:
It almost feels like the looping behavior is very similar in both the install case and the hang case. |
Can you delete the IMEX source files and try again? They should be in the |
As to why Access is hanging during the export, you might check your current error handling settings. If your database does not allow breaking on errors, it will simply hang the program if an error is encountered. (Make sure the following box is checked to view/debug errors.) One of the great benefits of having this add-in written in VBA is that you can actually debug and step through the source code live, just like you debug your own database application. I recommend setting your VBA general options to Break in Class Modules: There is also a setting in the add-in that will give you more opportunity to debug unexpected errors with the add-in code: I recommend this for anyone actively developing the add-in, or trying to troubleshoot edge cases. Hope that helps! |
Deleted the two wonky imexspecs and re-exported, and all is working smoothly now. |
Awesome! Thanks for the update! |
If a key name includes a special character like a double quote, this should be escaped before outputting as JSON. Fixes #259
Errors during imex spec export:
Export.log
The text was updated successfully, but these errors were encountered: