Consider downloading Microsoft Visual Studio to use as a code editor for C++, Visual Basic, and other languages. The software can help you find and correct errors in code that you are attempting to execute. A good example of a visual basic code run in Visual Studio is demonstrated by KRob314to636 in this YouTube posting. The code he enters into Visual Studio is available here. Follow the instructions in the video to create a form, and then right click and select 'View Code'. Paste in the code and you should see how it needs to be corrected by changing the names of the text boxes to match those used in your form.
The code creates a little program that both collects new user name and password pairs, and then authenticates subsequent attempts to log in. It does this by generating hash values that referenced each time a password is entered. Hash values will appear in text files saved at C:\Users\[user name]\Documents\Visual Studio 2015\Projects\[projectname]\[projectname]\bin\Debug
There are lots of useful C++ and Visual Basic codes posted to the web that you can make use. Visual Studio is a great tool to make them work.