How to use VBA-JSON in Visual Studio VBA application? - json

I am novice in VBA, but I never thought I will have a problem like that anyway. Well, the problem is next.
I need to parse json from api in my VBA app. I am trying to use VBA-JSON library (https://github.com/VBA-tools/VBA-JSON), cause I failed to find somewhere any other suitable solution for this task. The reason I have to write here about this, is that there are billions of guides how to install this library if you use Visual Basic in Excel, but no information how to do it if you use Visual Studio.
When following instructions I am trying to import this "JsonConverter.bas" into my project, I can do this, but it is not recognized correctly, as I can see.
Errors
There is written, that:
"Add Dictionary reference/class
For Windows-only, include a reference to "Microsoft Scripting Runtime"", and I added it in references.
Reference is added
Of course I get build errors when I am trying to run application.
So, could somebody tell me please, where is my mistake, and how to install this library?
Thank you in advance.

Related

How to open this .net project with no errors

I have this project from github, database on sales and inventory system. But when I open it, it encounters errors.
I really need help on how to open this project with no errors? What should I do to fix this project?
PS: Need a step by step explanation regarding this, I just started databases, so I'm not sure what other tools I should be needing like MS Access or SQL.
The error is self-explanatory: underlined data types cannot be found.
That's means these types are defined in assemblies, currently not available to the compiler.
So in order to build the solution you need to supply these assemblies. There are multiple options, but I'd recommend doing this through NuGet as it is fully automated(you know about it, right?).
The missing assembly is related to the Microsoft.Reporting. So install this and try to build again.

How to install JSON for Visual Studio 2013?

I Installed the Nuget Package Installer thing, and it says it installed it.
However I can't find any references to JSON in Visual Studio.
I tried using System.JSON but I can't find it.
How can I use it?
Thanks
I have had been through the same trouble today, when I almost completed my Software Project and just had to use the File to use its contents to change the content of the Project.
For that I wanted to use JsonObject class to get the contents of the .json file. When I tried to write this
using System.Json;
It gave me the exact same error that you might have been going through. It asked for the Assembly files and DLLs.
I kept searching and I stumbled upon to this post, which was totally unhelpfull for me. So I searched and got what I was looking for. After that, I wanted to share that triumph with you people too so that next visitor must have an answer to his trouble on Stack Overflow.
Solution
What I did was, I went to the NuGet website for the System.Json extension package.
http://www.nuget.org/packages/System.Json
There, I capture the command for the installation.
I just click on the Tools --> NuGet package manager --> Package Manager Console and it gave me a new window in the bottom part of Visual Studio 2013.
There I typed (pasted) the link of command I copied. It started and installed the package for me. And now I can use it!
Further answer
I was told that it is a part of .NET v4.5, but I even have the v4.5.1 and still I don't get it why I don't have that package, maybe because on the Web page of the package it is shown deprecated. But still who ever needs it, can have the answer I have posted and it would help him out!
Good luck!
I think you can use the Newtonsoft JSON.NET package.
http://www.nuget.org/packages/newtonsoft.json/
I was also looking for a way to do JSON in C# and saw that they made it easier with .NET 4.5, couldn't do it and found this stack overflow question. I wasn't really satisfied with Afzaal Ahmad Zeeshan's answer so I kept searching and found this which I guess isn't depreciated and worked for me.
Steps in plain English (for .NET 4.5):
1.Add Reference to System.Runtime.Serialization
2.Add "using System.Runtime.Serialization.Json;" to your class
3.call "JsonReaderWriterFactory.CreateJsonReader()" or whatever methods you need to use to read/write json
Install latest VS 2017
Install-Package System.Runtime.Serialization.Json -Version 4.3.0
-- in PM console

QJSon in Qt4.7 - how to install/use

I'm using Qt4.7 on a Windows machine. I can't update Qt to version 5 and I'm unable to install CMake.
I need to use QJSon for a project, but it seems to be only available natively on Qt5+. Can anyone instruct me on how to "backport" it or something?
I also found this class for JSON handling that might serve the same purpose. If I wanted to use it instead, do I only need to import it to my project?
Please escuse me if this is all too simple/evident, but I'm new to desktop development, I only have some experience with webdesign, so any help is welcome. :)
Whilst you could attempt to backport QJson you're best off going for the second option, simply for ease. All you need to do is bring the files into your project, if you're using Qt Creator when you do 'Add existing...' it should automatically add the include and header to the compilation phase. If it doesn't you add them to the .pro file so the compiler knows what it needs to include.

"Post build event error"

I am using Visual Studio 2008 to build my projects.
I often take existing sample code and edit it and toy around with it, as I am just learning and I'd like to advance my skill.. it's nice to have a template to work with.
That being said, I often get the build error "Post build event failed". This is often accompanied by a "could not find xxx.sbr file" or something. I do not know what an sbr file is, not a "post-build event". Re-building doesn't seem to help, and clearing all the files out before tying another build does not help either.
That being said, the executable still always gets built.
I was wondering:
What is a post build event and what are the implications/causes of its failure?
What is an sbr file? I tried researching this a bit.. a "Source Browse File"? This site seemed pretty informative: http://www.ehow.com/facts_5657521_file-extension-sbr_.html
The problem is, I don't understand why the compiler would complain about not finding this (isn't it supposed to MAKE this?) and what EXACTLY it does ("enables Microsoft Visual Studio to access your source code" - can't it do this anyway?)
Thanks!
R
post build event is just a command you can have visual studio run after it's finished - maybe to kick off tests or build an installer.
It's in properties->build events in the menu - right click on the project.
The SBR file is used by visual studio to browse sources and lookup which function is in which file. I have had problems where somehow it's internal list of dependencies gets screwed up and it always rebuilds one of them.
Try a clean and rebuild, then try quitting visual studio and deleting the .ncb file

Is there a working Cocoa MySQL Xcode project?

Or has this been abandoned? I can't seem to find a modern sample project. I haven't been able to make any the old code I find work. I just want to write a simple Mac app that accesses an external MySQL database that's also involved in a PHP website.
The old CocoaMySQL project has been abandoned, but the project has been resurrected as Sequel Pro.
It's open source and you can get the source code here.
If you want a straight library that allows you to access MySQL, you might try the commercial MacSQL framework.
You can also just use the MySQL C API directly, however be careful because if you want to use this in a commercial app the licensing fees are high.
You might find it easier to write some PHP code on the server to deliver the results to your client using JSON or some other lightweight data interchange format. PHP has direct support for JSON and there is a great Cocoa framework that makes it easy to parse and generate JSON code.
This method allows you to completely abstract the database connection from your client, so it is relatively trivial to change the database if necessary in future.
Thanks, Rob, I have actually seen the links to Sequel Pro but I was confused when I got there. Part of my problem is that I am really bad at adding things to an Xcode project. Once I have a project in hand with the correct libraries and whatever all linked up, I can make use of the various methods or functions.
That's why I was asking if someone had a super simple project using MySQL that would hopefully compile for me right out of the box. I can then add all my objects and coding.
Can't seem to find anyone out there willing to hold the hand of us project-challenged. The project settings dialog box and codes that go in various boxes therein are very confusing to me.