In "Project settings/Lib/Object library modules" field add (full path and) file name of MySQLWrapp.lib, e.g. "c:\MyProject\lib/MySQLWrapp.lib". You can also use pragma comment in your source code, for example
The demo application is a simple UI client (DemoUIClient.exe).
Wrapper classes described in this article are implemented in SQLWrapp.dll.
MySQL C API functions are exported from libmysql.dll which is shipped with MySQL install kit. Please copy libmysql.dll into the application folder.
Left pane tree contains:
connection info, i.e. user and host in the root;
database names;
table names for each database.
Right pane displays:
if a database is selected - information about its tables (SHOW TABLE STATUS);
if a table is selected - table contents (SELECT * FROM table);
the result of a query entered by the user (see SQL/Query menu item).
For BLOB fields "<blob>" string is displayed in the list.
If click in a <blob> field and it contains a image (BITMAP, GIF, or JPEG) this is displayed in a picture tool window.
To update a <blob> field from a file right-click on it.
Demo Database
To install the demo database you can use mysql.exe command-line tool:
download and unzip test_db.sql script file.
launch mysql.exe from command line.
use source command to execute the SQL script file.
Example
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql --user=root --password=root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.7-beta-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> source c:\test_db.sql
MySQLWrapp was tested on MySQL versions 4.0.24, 4.1.11, and 5.0.7-beta.
libmysql.dll, libmysql.lib, and mysql header files are shipped with MySQL Database Server & standard clients.
The demo application is only for testing purpose and designed to be very simple. It has its limitations, and its not a full featured MySQL UI client application.
About the Author
Graduated with a degree in Electronics and Telecommunications from the Technical University of Iasi in 1986. However, in 1994 he again met his first love from high school: computer science. He began programming at a company specializing in financial software. Since 2002, he's been a project manager for WAM (work area management) applications used in medical laboratories. During that time, he's dealt with many programming languages, beginning with old Fortran. Actually, he programs in C++ using Visual Studio, MFC, Windows API, and COM.
Add www.codeguru.com to your favorites Add www.codeguru.com to your browser search box IE 7 | Firefox 2.0 | Firefox 1.5.xReceive news via our XML/RSS feed
RATE THIS ARTICLE:
Excellent Very Good Average Below Average Poor
(You must be signed in to rank an article. Not a member? Click here to register)