Monday, October 22, 2018

Using MS SQL Server from C++ with wxWidgets



Using SQL Server with ODBC, C++, and wxWidgets

In this article, we will discuss about using MS SQL server with ODBC API from C++ program. [Eas18]. Thereafter, we will create a class module that connects to SQL server and use it with an example wxWidgets GUI application. For Unix and Linux machines, FreeTDS and ODBC need to be setup as discussed at the following link.

Using Microsoft SQL Server from Linux Machines with ODBC & FreeTDS
(http://coolemerald.blogspot.com/)


Friday, October 5, 2018

Using Microsoft SQL Server from Linux Machines with ODBC & FreeTDS

FreeTDS is a set of libraries for Unix and Linux machines to use Microsoft SQL server and Sybase databases [Fre16]. FreeTDS C libraries are free, opensource, and distributed under GNU LGPL license. In this article, I will discuss about using MS SQL server located on a Windows machine which is installed using mixed mode authentication. The MS SQL server must be configured to allow remote connection with TCP/IP using username and password. That MS SQL server is to be connected and used from a Linux machine using FreeTDS.

MS SQL server is a result of cooperation between Microsoft and Sybase. Therefore, their SQL servers are quite similar and the communication protocols are almost identical. That protocol is called Tabular Data Stream (TDS). The project for open source implementation of TDS is started by Brian Bruns and it is called FreeTDS.

Thursday, October 4, 2018

MySQL Connector C++ 8.0 with wxWidgets

Let us discuss about using MySQL Connector C++ 8.0 with wxWidgets. Details about setting up and using wxWidgets, and MySQL server and connector can be found at the following links.

ceMySQL.h Cross-platform C++ programming with wxWidgets

Using MySQL Database with C++ on Various Platforms Including ARM Single Board Computers

For this example, by using MySQL Workbench, we will create a database called 'mytest' and a table called 'mytable' in the MySQL server that is to be connected and used.


Figure 1. Creating a database 'mytest' and a table 'mytable' using MySQL Workbench.


Tuesday, October 2, 2018

Safe and easy DIY Home Energy Monitor Using Current Transformer with Arduino, Raspberry Pi, or Beaglebone Black

To measure and monitor the energy usage of home appliances, let us build a simple and basic energy monitor. Although there are several methods to build energy monitors, I have chosen YHDC Current Transformer SCT-013-000 [YHD18] for it. Because it is non-invasive, safe, and suitable for learning. It is a split-core current transformer so that it can be fastened and used easily without the requirement to touch the high voltage power lines. Note that only one power cable is to be put in the core as shown in Figure 1.


Figure 1. (Left) SCT-013 is split core so that it can be easily clipped on a wire. (Center) If all the wires are put inside the core, input and output currents are cancelled. Therefore the net current will be zero. (Right) It is required to put only one wire in the core.