Install
There are two ODBC types in linux: unixODBC and iodbc. Because wxGTK supports iodbc, you must install iodbc before installing wxGTK. When freetds is installed later, unixODBC may also be installed based on the environment and dependency. The ODBC configuration files modified by iodbc and unixODBC are both/etc/odbc. ini and/etc/odbcinst. ini, these two are ODBC driver managers, there is no conflict, but if you want to use wxODBC for ODBC development, iodbc must be installed.
Install iodbc
If the yum source contains libiodbc, you can directly use yum install libiodbc * or search for the iodbc package in yumex for installation. Otherwise, you need to download the relevant rpm package online for installation.
Download libiodbc-3.52.6-1.i386.rpm
Download libiodbc-devel-3.52.6-1.i386.rpm
Download libiodbc-admin-3.52.6-1.i386.rpm
Download libiodbc-3.52.6-1.src.rpm
Rpm-ivh libiodbc-3.52.6-1.i386.rpm
Rpm-ivh libiodbc-devel-3.52.6-1.i386.rpm
Rpm-ivh libiodbc-admin-3.52.6-1.i386.rpm
Rpm-ivh libiodbc-3.52.6-1.src.rpm
Install wxGTK
./Configure -- with-odbc -- enable-monolithic -- enable-xrc -- enable-unicode
Make
Make install
Install codeblocks
Cp/usr/local/share/aclocal/wxwin. m4/usr/share/aclocal/wxwine. m4
./Bootstrap (aclocal may be required)
./Configure -- with-contrib-plugins = all
Make
Makeinstall
Connect to SQL Server
Install freetds
Yum install freetds *
(Or after yum yumex is installed, run yumex to search for freetds in all packages. Three packages are installed, and the other two are the develop and doc packages)
Configure ODBC driver
/Usr/bin/iodbcadm-gtk
ADD a driver to the ODBC Drivers midpoint
Enter the description of the driver to connect to the database, such as MSSQL or SQL server.
Enter/usr/lib/libtdsodbc. so in the driver file name. (The specific path may vary depending on the version. You can search libtdsodbc. so to find the specific path)
Enter/usr/lib/libtds. so in Setup file name (the specific path may be different)
Click OK to save ODBC driver settings
Configure DSN
Switch iodbcadm-gtk to system DSN
Click Add. In the displayed window, select the configured driver to be used and click OK.
Enter the Name of the new DSN Source in Data Source Name (DSN ).
Create the following Keyword and enter the value
Keyword Value
Databases Used
Port Number (SQL Server is 1433)
Server (IP address available)
TDS_Version 8.0
Trace No
Click OK to save DSN
Click Test to Test the data source. In the pop-up window, enter the user name and password, and click OK to view the Test results.
Click OK to exit iodbcadm-gtk
Available
Isql-v DSN name Username Password
Connection DSN
MySQL
Install driver
Use yumex to check whether the mysql-connector-odbc package is installed. If not, use yum install mysql-connector-odbc for installation.
Configure ODBC driver
Switch to ODBC Drivers in iodbcadm-gtk and click ADD a driver.
Enter the description of the driver to connect to the database, for example, MySQL.
Enter/usr/lib/libmydbc3.so in the driver file name (the name may vary depending on the mysql driver version, for example, libmyodbc. so)
Enter/usr/lib/libodbcmyS. so in Setup file name. The specific paths may vary)
Click OK to save ODBC driver settings
Configure DSN
Switch iodbcadm-gtk to system DSN
Click Add. In the displayed window, select the configured driver to be used and click OK.
Enter the Name of the new DSN Source in Data Source Name (DSN ).
Create the following Keyword and enter the value
Keyword Value
Databases Used
Server (IP address available)
User Username
Password
Click OK to save DSN
Click Test or use
Isql-v DSN name Username Password